SyTen

◆ pseudo_inverse_svd()

template<typename Scalar >
std::pair< DenseTensor< 2, Scalar >, double > syten::pseudo_inverse_svd ( DenseTensor< 2, Scalar > const &  input)

Takes a row-major input and pseudo-inverts it using a SVD.

Singular values smaller than SYTEN_SMALL_THRESHOLD relative to the largest singular value will be assumed zero. The pseudo-inverse \( G \) of a matrix \( A \) is defined by its property that \( A \cdot G \cdot A = A \). With the pseudo_inverse_svd_cm() function, the average absolute value of the entries of \( A \cdot G \cdot A - A \) is usually smaller than SYTEN_SMALL_THRESHOLD times the ratio of largest to smallest singular value (which is returned as the second element of the pair here).

Remarks
Since the SVD requires a column-major matrix, the matrix will be transposed here. Consider using pseudo_inverse_svd_cm() directly if possible.
Returns
the pseudoinverse in row-major form and the ratio \( s_0 / s_i \) where \( s_i \) is the smallest singular value which was not taken to zero.

References pseudo_inverse_svd_cm(), and transpose().

+ Here is the call graph for this function: