21 #include <tensor/tensor.h>
22 #include <tensor/linalg.h>
26 using namespace tensor;
44 for (tensor::index i = 0; i < s.
size(); i++) {
46 U = U(range(), range(0,i-1));
48 VT = VT(range(0,i-1), range());
52 scale_inplace(X, 0, 1.0/s);
53 return foldc(VT, 0, X, 0);
Real Tensor with elements of type "double".
index size() const
Returns total number of elements in Tensor.
const RTensor solve_with_svd(const RTensor &A, const RTensor &B, double tol=0.0)
Solution of a linear system of equations using Penrose's pseudoinvese.
RTensor svd(RTensor A, RTensor *pU=0, RTensor *pVT=0, bool economic=0)
Singular value decomposition of a real matrix.