Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
xerus
xerus
Commits
15bca0b0
Commit
15bca0b0
authored
May 29, 2017
by
Ben Huber
Browse files
removed dead code
parent
d7941c88
Changes
3
Hide whitespace changes
Inline
Side-by-side
doc/jekyll/images/xerus.png
View replaced file @
d7941c88
View file @
15bca0b0
3.86 KB
|
W:
|
H:
3.81 KB
|
W:
|
H:
2-up
Swipe
Onion skin
include/xerus/algorithms/crossApproximation.h
deleted
100644 → 0
View file @
d7941c88
// Xerus - A General Purpose Tensor Library
// Copyright (C) 2014-2017 Benjamin Huber and Sebastian Wolf.
//
// Xerus is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published
// by the Free Software Foundation, either version 3 of the License,
// or (at your option) any later version.
//
// Xerus is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with Xerus. If not, see <http://www.gnu.org/licenses/>.
//
// For further information on Xerus visit https://libXerus.org
// or contact us at contact@libXerus.org.
/**
* @file
* @brief Header file for the cross approximation algorithm and its variants.
*/
#pragma once
#include
"../ttNetwork.h"
#include
"../performanceData.h"
#include
"../measurments.h"
namespace
xerus
{
// TTTensor cross_approximation(const Tensor& _input, const std::vector<size_t> &_ranks);
}
src/xerus/algorithms/crossApproximation.cpp
deleted
100644 → 0
View file @
d7941c88
// Xerus - A General Purpose Tensor Library
// Copyright (C) 2014-2017 Benjamin Huber and Sebastian Wolf.
//
// Xerus is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as published
// by the Free Software Foundation, either version 3 of the License,
// or (at your option) any later version.
//
// Xerus is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with Xerus. If not, see <http://www.gnu.org/licenses/>.
//
// For further information on Xerus visit https://libXerus.org
// or contact us at contact@libXerus.org.
/**
* @file
* @brief Implementation of the ALS variants.
*/
#include
<xerus/algorithms/als.h>
#include
<xerus/basic.h>
#include
<xerus/tensorNetwork.h>
#include
<xerus/indexedTensor_tensor_factorisations.h>
namespace
xerus
{
///@brief Creates a set of @a _num unique random index tuples, using the @a _dimensions starting at @a _position +1.
// std::vector<std::vector<size_t>> create_random_tuples(const std::vector<size_t>& _dimensions, const size_t _position, const size_t _num) {
// const size_t N = _dimensions.size()-_position;
//
// std::mt19937_64 rnd(rd());
// std::vector<std::uniform_int_distribution<size_t>> dists;
// for(size_t d = 0; d < N; ++d) {
// dists.emplace_back(0, _dimensions[_position+d]);
// }
//
// std::vector<std::vector<size_t>> tuples(_num, std::vector<size_t>(N, 0));
//
// for(size_t i = 0; i < _num; ++i) {
// // Create a random tuple.
// for(size_t d = 0; d < N; ++d) {
// tuples[i][d] = dists[d](rnd);
// }
//
// // Redo this one if it is non unique.
// for(size_t j = 0; j < i; ++j) {
// if(tuples[i] == tuples[j]) { --i; break; }
// }
// }
//
// return tuples;
// }
//
// TTTensor cross_approximation(const Tensor& _input, const std::vector<size_t> &_ranks) {
// std::mt19937_64 rnd(rd());
//
// TTTensor reconstruction(_input.dimensions.size());
//
//
// std::vector<std::vector<size_t>> leftTuples;
//
// reconstruction.set_component(0, Tensor({1, _input.dimensions[0], _ranks[0]}, Tensor::Representation::Dense, Tensor::Initialisation::None));
// std::vector<std::vector<size_t>> tuples = create_random_tuples(_input.dimensions, 0, _ranks[0]);
//
// for(size_t i = 0; i < _input.dimensions[0]; ++i) {
// for(size_t j = 0; j < tuples.size(); ++j) {
// std::vector<size_t> index(1, i);
// index.insert(index.end(), tuples[j].begin(), tuples[j].end());
// reconstruction.component(0)[{0,i,j}] = _input[index];
// }
// }
//
// std::uniform_int_distribution<size_t> dist(0, _input.dimensions[0]);
//
// for(size_t i = 0; i < _ranks[0]; ++i) {
// leftTuples.emplace_back(dist(rnd));
// }
//
// for(size_t position = 0; position < _input.degree()-1; ++position) {
// // std::vector<std::vector<size_t>> tuples = create_random_tuples(_input.dimensions, position, _ranks[position]);
//
// // reconstruction.set_component(position, Tensor({_ranks[position-1], _input.dimensions[position], _ranks[position]}, Tensor::Initialisation::None));
// }
//
// return reconstruction;
// }
}
// namespace xerus
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment