36#ifndef STK_LAPACK_SVD_H
37#define STK_LAPACK_SVD_H
138 template<
class OtherArray>
179 msg_error_ =
_T(
"In lapack::Svd::runImpl, the options 'A' and 'S' are not available");
185 if ( (
jobz_ ==
'O' &&
U_.sizeRows() >=
U_.sizeCols()) ||
jobz_ ==
'N')
204 int m = a.sizeRows(), n = a.sizeCols(),
nbSv = std::min(
m,n);
231 if ( !((
jobz_ ==
'O' &&
m >= n) || (
jobz_ ==
'N')) )
236 if ( !((
jobz_ ==
'O' &&
m < n) || (
jobz_ ==
'N')) )
248 ,
u.p_data(),
u.sizeRows()
249 ,
vt.p_data(),
vt.sizeRows()
In this file we implement the final class CArrayVector.
In this file we implement the final class CArray.
In this file we define the interface class ISvd.
#define STKERROR_NO_ARG(Where, Error)
#define STKERROR_1ARG(Where, Arg, Error)
#define _T(x)
Let x unmodified.
In this file we define and implement utilities classes and methods for the interface with lapack.
In this file we define the transpose method.
Derived & resize(Range const &I, Range const &J)
resize the Array.
Derived & shift(int beginRows, int beginCols)
shift the Array.
Type *const & p_data() const
String msg_error_
String with the last error message.
String const & error() const
get the last error message.
Compute the Singular Value Decomposition of an array.
ArrayD D_
Diagonal array of the singular values.
ISvd & operator=(const ISvd &S)
Operator = : overwrite the ISvd with S.
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
The class Svd compute the Singular Value Decomposition of a Array with the Golub-Reinsch Algorithm.
bool computeSvd()
Svd main steps.
Svd(Svd const &decomp)
Copy constructor.
Svd(CArrayXX const &A, bool ref=false, bool withU=true, bool withV=true)
Default constructor.
Svd & operator=(Svd const &decomp)
Operator = : overwrite the Svd with decomp.
bool computeSvd(CArrayXX &a, CArrayXX &u, CVectorX &s, CArrayXX &v)
compute the svd decomposition.
bool runImpl()
Run svd decomposition.
hidden::Traits< CArrayXX >::Col ColVector
virtual Svd * clone() const
clone pattern
virtual ~Svd()
virtual destructor
hidden::Traits< CArrayXX >::Row RowVector
Svd(ArrayBase< OtherArray > const &A, bool withU=true, bool withV=true)
constructor with other kind of array/expression
void setJobz(char jobz)
set the option chosen for the svd
TContainer2D & transpose(ArrayBase< TContainer2D > &A)
The transpose method allow to transpose an array in place.
int gesdd(char jobz, int m, int n, Real *a, int lda, Real *s, Real *u, int ldu, Real *vt, int ldvt, Real *work, int lWork, int *iWork)
wrapper of the LAPACK DGESDD routine.
double Real
STK fundamental type of Real values.
The namespace STK is the main domain space of the Statistical ToolKit project.
traits class for the algebra methods.