27 typedef typename Real_::DoubleType Double_;
29 typedef Alge_<Real> Alge;
30 typedef Alge_<Double> Alge_d;
51 sdt m = a.rows(), n = a.cols();
60 jacobi(_ut, _w, _wd, _vt, _rand);
69 jacobi(_vt, _w, _wd, _u, _rand);
80 sdt m = a.rows(), n = a.cols();
87 jacobi(_ut, _w, _wd,
optnull, _rand);
92 jacobi(_vt, _w, _wd,
optnull, _rand);
99 template<
class B,
class X>
107 const Vec&
w()
const {
return _w; }
109 const Matrix&
u()
const {
return _u; }
111 const Matrix&
vt()
const {
return _vt; }
126 extern template class Svd<Float>;
127 extern template class Svd<Double>;
128 extern template class Svd<Quad>;
void solve(const MatrixBase< B > &b, MatrixBase< X > &x)
Solve the linear system where A is the decomposed matrix. A and B row sizes must match...
Definition: Svd.h:100
Random number generator interface.
Definition: Gen.h:11
Svd(const MatrixBase< T > &a, Mode mode=Mode::reduced)
Calculate the SVD of matrix A.
Definition: Svd.h:45
static optnull_t optnull
Null optional, use to reset an optional to an uninitialized state or test for initialization.
Definition: Optional.h:12
const Matrix & u() const
Get the left singular column vectors of the decomposition.
Definition: Svd.h:109
matrix::Block< MatrixS, Rows, Cols > block(sdt row, sdt col, sdt rows=-1, sdt cols=-1)
Get block at offset (row,col) with size (Rows, Cols). If Rows or Cols is fixed then rows or cols may ...
Definition: Base.h:252
ptrdiff_t sdt
Size difference type, shorthand for ptrdiff_t.
Definition: Core.h:92
const Matrix & vt() const
Get the right singular row vectors of the decomposition.
Definition: Svd.h:111
Vec< matrix::dynamic, Double > Vec_d
Definition: Svd.h:33
static std::common_type< Num, Num2 >::type min(Num a, Num2 b)
Get the minimum of two numbers.
Definition: Alge.h:89
ChaCha8, a cryptographically secure pseudo random number generator.
Definition: Chacha.h:41
Singular Value Decomposition. Can be used to calculate the pseudo-inverse of any matrix or solve leas...
Definition: Base.h:13
MatrixS & resize(sdt rows, sdt cols)
Sets number of rows/columns and reallocates only if the size has changed (rows*cols). All previous data is lost on reallocation. Returns self.
Definition: Base.h:277
Matrix< matrix::dynamic, matrix::dynamic, Real > Matrix
Definition: Svd.h:32
Enables any type to be optional so it can exist in an uninitialized null state.
Definition: Optional.h:52
Svd & calcValues(const MatrixBase< T > &a)
Calculate the singular values of matrix A. This is a fast method for when the left and right singular...
Definition: Svd.h:78
double Real
Definition: Real.h:14
Numeral< Real >::Real_ Real_
Operations and constants for Real type. See Float_, Double_.
Definition: Real.h:25
Svd & calc(const MatrixBase< T > &a, Mode mode=Mode::reduced)
Calculate the SVD of matrix A.
Definition: Svd.h:49
Vec< matrix::dynamic, Real > Vec
Definition: Svd.h:34
void inverse(MatrixBase< T > &res)
Calculate the inverse of A, the decomposed matrix.
Definition: Svd.h:104
Matrix base class.
Definition: Base.h:17
void transposeInPlace()
transpose and store in this matrix, only valid for square matrices
Definition: Base.h:328
const Vec & w() const
Get the singular values of the decomposition.
Definition: Svd.h:107
Svd()
Definition: Svd.h:42
Global Honeycomb namespace.
Res && transpose(Res &&res) const
transpose and store result in res. Returns res.
Definition: Base.h:314
Back substitute to solve a linear system.
Definition: BackSub.h:11
VecS & resize(sdt dim)
Sets number of dimensions and reallocates only if different. All previous data is lost on reallocatio...
Definition: Base.h:69