Delinearisation decomposition. More...
Functions | |
template<typename Scalar > | |
std::vector< std::pair< Index, int > > | calculate_scores (std::vector< DenseTensor< 1, Scalar > > const &columns, std::vector< DenseTensor< 1, Scalar > > const &thresh) |
Calculates the zeroness score of all columns comparing against all others. More... | |
template<typename Scalar > | |
void | cols (DenseTensor< 2, Scalar > const &a, DenseTensor< 2, Scalar > &p, DenseTensor< 2, Scalar > &t, DenseTensor< 2, typename ScalarBase< Scalar >::type > const &thresholds_in=DenseTensor< 2, typename ScalarBase< Scalar >::type >(), bool const relax_if_necessary=false) |
Calculates \( p \), \( t \) s.t. \( p·t = a \) and \( p
\) has as few columns as possible. More... | |
template<Rank rank> | |
Index | cols (Tensor< rank > const &in, Index const uncombinedLeg, Tensor< rank > &p, Tensor< 2 > &t, std::vector< Index > leading_dimensions=std::vector< Index >(), bool relax_if_necessary=false) |
Column-based Delinearisation. More... | |
template<typename Scalar > | |
DenseTensor< 2, typename ScalarBase< Scalar >::type > | cols_only (DenseTensor< 2, Scalar > const &a, DenseTensor< 2, Scalar > &p, DenseTensor< 2, Scalar > &t, DenseTensor< 2, typename ScalarBase< Scalar >::type > const &thresholds) |
De-linearises the columns of a matrix based on the provided thresholds. More... | |
template<typename Scalar > | |
bool | compare_residual (DenseTensor< 1, Scalar > const &original, DenseTensor< 1, Scalar > const &calculated, DenseTensor< 1, Scalar > const &threshold, SRDef factor) |
Returns true if original[i] ~ calculated[i] to within threshold[i] * factor. More... | |
template<typename Scalar > | |
std::vector< Index > | count_all_zeros (std::vector< DenseTensor< 1, Scalar > > const &vec) |
Counts the number of exactly-zero entries of each element of vec . More... | |
template<typename Scalar > | |
std::vector< Index > | count_bottom_zeros (std::vector< DenseTensor< 1, Scalar > > const &vec) |
Counts the number of zeros from the bottom in each entry of vec . More... | |
template<typename Scalar > | |
DenseTensor< 2, Scalar > | permute (std::vector< DenseTensor< 1, Scalar > > &columns, std::vector< DenseTensor< 1, Scalar > > &thresh) |
Permutes columns in columns and thresh such that the columns with maximal zeroness score are in the front. More... | |
template<typename Scalar > | |
void | postprocess_coefficient (Scalar &c, Index num_entries) |
Shifts coefficients to 0, 1 and -1. More... | |
template<typename Scalar > | |
void | rows (DenseTensor< 2, Scalar > const &a, DenseTensor< 2, Scalar > &t, DenseTensor< 2, Scalar > &p, DenseTensor< 2, typename ScalarBase< Scalar >::type > const &thresholds=DenseTensor< 2, typename ScalarBase< Scalar >::type >(), bool const relax_if_necessary=false) |
Calculates \( p \), \( t \) s.t. \( t·p = a \) and \( p
\) has as few rows as possible. More... | |
template<Rank rank> | |
Index | rows (Tensor< rank > const &in, Index const uncombinedLeg, Tensor< 2 > &t, Tensor< rank > &p, std::vector< Index > leading_dimensions=std::vector< Index >(), bool relax_if_necessary=false) |
Row-based Delinearisation. More... | |
Delinearisation decomposition.