MADNESS
0.10.1
|
#include <RandomizedMatrixDecomposition.h>
Classes | |
struct | Y_former |
functor for forming Y = matrix * randomvector More... | |
Public Types | |
typedef TensorTypeData< T >::scalar_type | scalar_type |
Public Member Functions | |
RandomizedMatrixDecomposition ()=default | |
RandomizedMatrixDecomposition (const RandomizedMatrixDecomposition &other)=default | |
RandomizedMatrixDecomposition (const RMDFactory &factory) | |
RandomizedMatrixDecomposition (const Tensor< T > &matrix, const double thresh) | |
Tensor< T > | compute_range (const Tensor< T > &columnspace, const Tensor< T > &rowspace, const double &eps) |
compute the range of the matrix given in decomposed form More... | |
Tensor< T > | compute_range (const Tensor< T > &tensor, const double &eps, std::array< long, 2 > matrixdim={0, 0}) |
compute the range of the matrix More... | |
bool | exceeds_maxrank () const |
check if the computed rank is too large More... | |
Tensor< T > | get_range () const |
void | set_maxrank (const long max_rank) |
Static Public Member Functions | |
static scalar_type | check_range (const Tensor< T > &matrix, const Tensor< T > &range) |
return the error of the range Q More... | |
static Tensor< T > | make_SVD_decaying_matrix (const Tensor< T > &matrix, const int n=1) |
helper function More... | |
static Tensor< T > | resize_to_matrix (const Tensor< T > &matrix, std::array< long, 2 > vectordim={0, 0}) |
resize Tensor to a matrix More... | |
Private Member Functions | |
Tensor< T > | do_compute_range (const Y_former &Y, const double &eps) const |
perform the actual computation of the range More... | |
Private Attributes | |
long | maxrank =LONG_MAX |
maximum rank to abort the decomposition More... | |
long | oversampling =10 |
oversampling parameter More... | |
Tensor< T > | range =Tensor<T>(0l,0l) |
the range that spans the input matrix More... | |
typedef TensorTypeData<T>::scalar_type madness::RandomizedMatrixDecomposition< T >::scalar_type |
|
default |
|
default |
|
inline |
|
inline |
|
inlinestatic |
return the error of the range Q
explicitly compute the error measure || A - Q Q^T A ||
References madness::conj(), madness::inner(), madness::RandomizedMatrixDecomposition< T >::range, and residual().
Referenced by test_stuff().
Tensor< T > madness::RandomizedMatrixDecomposition< T >::compute_range | ( | const Tensor< T > & | columnspace, |
const Tensor< T > & | rowspace, | ||
const double & | eps | ||
) |
compute the range of the matrix given in decomposed form
see above; Matrix is given by A(i,j)=columnspace(r,i) * rowspace(r,j)
[in] | columnspace | columnspace of the input tensor/matrix A |
[in] | rowspace | rowspace of the input tensor/matrix A |
[in] | eps | the accuracy of the representation |
References madness::BaseTensor::dim(), MADNESS_ASSERT, madness::BaseTensor::ndim(), Q(), and madness::BaseTensor::size().
Tensor< T > madness::RandomizedMatrixDecomposition< T >::compute_range | ( | const Tensor< T > & | tensor, |
const double & | eps, | ||
std::array< long, 2 > | matrixdim = {0,0} |
||
) |
compute the range of the matrix
compute the range of the matrix, following Alg 4.2 of Halko, Martinsson, Tropp, 2011
follows Halko, Martinsson, Tropp (2011), Alg. 4.2 the final range will satisfy for the input tensor A: || A - Q Q^T A || < eps method will change member variables "range" and "maxrank"
[in] | tensor | the input tensor/matrix A (see matrixdim if not a matrix) |
[in] | eps | the accuracy of the representation |
[in] | matrixdim | how to reshape the tensor if it is not a matrix |
References madness::Tensor< T >::normf().
Referenced by madness::RandomizedMatrixDecomposition< T >::RandomizedMatrixDecomposition(), madness::SVDTensor< T >::compute_randomized_svd(), madness::SVDTensor< T >::orthonormalize_random(), and test_stuff().
|
private |
perform the actual computation of the range
References madness::_(), madness::conj(), madness::BaseTensor::dim(), madness::Tensor< T >::fillrandom(), madness::inner(), madness::RandomizedMatrixDecomposition< T >::Y_former::m(), MADNESS_EXCEPTION, madness::RandomizedMatrixDecomposition< T >::Y_former::maxrank(), madness::RandomizedMatrixDecomposition< T >::Y_former::n(), madness::Tensor< T >::normf(), madness::constants::pi, Q(), madness::qr(), and R.
|
inline |
check if the computed rank is too large
References madness::RandomizedMatrixDecomposition< T >::maxrank, and madness::RandomizedMatrixDecomposition< T >::range.
Referenced by madness::SVDTensor< T >::compute_randomized_svd(), and test_stuff().
|
inline |
References madness::RandomizedMatrixDecomposition< T >::range.
Referenced by test_stuff().
|
inlinestatic |
helper function
References madness::_(), madness::inner(), and madness::svd().
Referenced by test_stuff().
|
inlinestatic |
resize Tensor to a matrix
Referenced by madness::SVDTensor< T >::compute_svd(), and madness::SVDTensor< T >::compute_svd_from_range().
|
inline |
|
private |
maximum rank to abort the decomposition
Referenced by madness::RandomizedMatrixDecomposition< T >::exceeds_maxrank(), and madness::RandomizedMatrixDecomposition< T >::set_maxrank().
|
private |
oversampling parameter
|
private |
the range that spans the input matrix
Referenced by madness::RandomizedMatrixDecomposition< T >::RandomizedMatrixDecomposition(), madness::RandomizedMatrixDecomposition< T >::check_range(), madness::RandomizedMatrixDecomposition< T >::exceeds_maxrank(), and madness::RandomizedMatrixDecomposition< T >::get_range().