mptensor v0.6.0
Parallel Library for Tensor Network Methods
Loading...
Searching...
No Matches
rsvd.hpp
Go to the documentation of this file.
1/*
2 mptensor - Parallel Library for Tensor Network Methods
3
4 Copyright 2016 Satoshi Morita
5
6 mptensor is free software: you can redistribute it and/or modify it
7 under the terms of the GNU Lesser General Public License as
8 published by the Free Software Foundation, either version 3 of the
9 License, or (at your option) any later version.
10
11 mptensor is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
15
16 You should have received a copy of the GNU Lesser General Public
17 License along with mptensor. If not, see
18 <https://www.gnu.org/licenses/>.
19*/
20
29#ifndef _TENSOR_RSVD_HPP_
30#define _TENSOR_RSVD_HPP_
31
32#include "mptensor/tensor.hpp"
33
34namespace mptensor {
35
38template <typename MatrixType>
39int rsvd(const Tensor<MatrixType>& a, const Axes& axes_row,
40 const Axes& axes_col, Tensor<MatrixType>& u, std::vector<double>& s,
41 Tensor<MatrixType>& vt, const size_t target_rank,
42 const size_t oversamp);
43
44template <typename MatrixType>
45int rsvd(const Tensor<MatrixType>& a, const Axes& axes_row,
46 const Axes& axes_col, Tensor<MatrixType>& u, std::vector<double>& s,
47 Tensor<MatrixType>& vt, const size_t target_rank);
48
49template <typename MatrixType, typename Func1, typename Func2>
51 const Shape& shape_col, Tensor<MatrixType>& u, std::vector<double>& s,
52 Tensor<MatrixType>& vt, const size_t target_rank,
53 const size_t oversamp);
54
55template <typename MatrixType, typename Func1, typename Func2>
57 const Shape& shape_col, Tensor<MatrixType>& u, std::vector<double>& s,
58 Tensor<MatrixType>& vt, const size_t target_rank);
59
60inline void set_seed(unsigned int seed);
62
63} // namespace mptensor
64
66#endif // _TENSOR_RSVD_HPP_
Index Shape
Definition index.hpp:215
Index Axes
Definition index.hpp:212
void set_seed(unsigned int seed)
Set seed for random number generator.
Definition rsvd_impl.hpp:206
int rsvd(const Tensor< MatrixType > &a, const Axes &axes_row, const Axes &axes_col, Tensor< MatrixType > &u, std::vector< double > &s, Tensor< MatrixType > &vt, const size_t target_rank, const size_t oversamp)
Singular value decomposition by randomized algorithm.
Definition rsvd_impl.hpp:82
mptensor::complex complex
Definition matrix_lapack.cc:36
Definition complex.hpp:34
Implementation of RSVD.
Tensor class.