STK++ 0.9.13
|
{ More...
#include <STK_lapack_Svd.h>
Public Types | |
typedef ISvd< Svd > | Base |
typedef hidden::Traits< CArrayXX >::Col | ColVector |
typedef hidden::Traits< CArrayXX >::Row | RowVector |
Public Member Functions | |
Svd (CArrayXX const &A, bool ref=false, bool withU=true, bool withV=true) | |
Default constructor. | |
template<class OtherArray > | |
Svd (ArrayBase< OtherArray > const &A, bool withU=true, bool withV=true) | |
constructor with other kind of array/expression | |
Svd (Svd const &decomp) | |
Copy constructor. | |
virtual | ~Svd () |
virtual destructor | |
virtual Svd * | clone () const |
clone pattern | |
Svd & | operator= (Svd const &decomp) |
Operator = : overwrite the Svd with decomp. | |
char | jobz () const |
void | setJobz (char jobz) |
set the option chosen for the svd | |
bool | runImpl () |
Run svd decomposition. | |
![]() | |
Type | det () const |
Type | trace () const |
Type | norm () const |
int | rank () const |
ArrayU const & | U () const |
ArrayV const & | V () const |
ArrayD const & | D () const |
virtual bool | run () |
implement the run method | |
void | setData (OtherArray const &A, bool withU=true, bool withV=true) |
Set a new data set to ISvd class. | |
OtherArray & | ginv (OtherArray &res) const |
Compute the generalized inverse of the matrix and put the result in res. | |
![]() | |
String const & | error () const |
get the last error message. | |
![]() | |
Derived & | asDerived () |
static cast : return a reference of this with a cast to the derived class. | |
Derived const & | asDerived () const |
static cast : return a const reference of this with a cast to the derived class. | |
Derived * | asPtrDerived () |
static cast : return a ptr on a Derived of this with a cast to the derived class. | |
Derived const * | asPtrDerived () const |
static cast : return a ptr on a constant Derived of this with a cast to the derived class. | |
Derived * | clone () const |
create a leaf using the copy constructor of the Derived class. | |
Derived * | clone (bool isRef) const |
create a leaf using the copy constructor of the Derived class and a flag determining if the clone is a reference or not. | |
Private Member Functions | |
bool | computeSvd (CArrayXX &a, CArrayXX &u, CVectorX &s, CArrayXX &v) |
compute the svd decomposition. | |
Private Attributes | |
char | jobz_ |
option | |
Additional Inherited Members | |
![]() | |
typedef hidden::AlgebraTraits< Svd >::ArrayU | ArrayU |
typedef hidden::AlgebraTraits< Svd >::ArrayD | ArrayD |
typedef hidden::AlgebraTraits< Svd >::ArrayV | ArrayV |
typedef ArrayU::Type | Type |
![]() | |
ISvd (ArrayU const &A, bool ref, bool withU=true, bool withV=true) | |
Default constructor. | |
ISvd (ArrayBase< OtherDerived > const &A, bool withU=true, bool withV=true) | |
constructor with other kind of array/expression | |
ISvd (ISvd const &S) | |
Copy Constructor. | |
virtual | ~ISvd () |
destructor. | |
ISvd & | operator= (const ISvd &S) |
Operator = : overwrite the ISvd with S. | |
virtual void | finalize () |
Finalize any operations that have to be done after the computation of the decomposition. | |
int | nrowU () const |
int | ncolU () const |
int | nrowD () const |
int | ncolD () const |
int | nrowV () const |
int | ncolV () const |
![]() | |
IRunnerBase () | |
default constructor | |
IRunnerBase (IRunnerBase const &runner) | |
copy constructor | |
virtual | ~IRunnerBase () |
destructor | |
virtual void | update () |
update the runner. | |
![]() | |
IRecursiveTemplate () | |
constructor. | |
~IRecursiveTemplate () | |
destructor. | |
![]() | |
ArrayU | U_ |
U_ matrix. | |
ArrayV | V_ |
V_ matrix. | |
ArrayD | D_ |
Diagonal array of the singular values. | |
bool | withU_ |
Compute U_ ? | |
bool | withV_ |
Compute V_ ? | |
Type | norm_ |
trace norm | |
int | rank_ |
rank | |
Type | trace_ |
trace norm | |
Type | det_ |
determinant | |
![]() | |
String | msg_error_ |
String with the last error message. | |
bool | hasRun_ |
true if run has been used, false otherwise | |
{
Svd computes the SVD decomposition of a real matrix using the Lapack routine dgeqrf.
The method take as:
A = UDV' (transpose V).
Output can be tuned using jobz
option:
* jobz is Char*1 * Specifies options for computing all or part of the matrix u: * = 'A': all m columns of u and all n rows of v**T are * returned in the arrays u and vt; * = 'S': the first min(m,n) columns of u and the first * min(m,n) rows of v**T are returned in the arrays U * and vt; * = 'O': If m >= n, the first n columns of u are overwritten * on the array a and all rows of v**T are returned in * the array vt; * otherwise, all columns of u are returned in the * array u and the first m rows of v**T are overwritten * in the array a; * = 'N': no columns of u or rows of v**T are computed. *
Definition at line 107 of file STK_lapack_Svd.h.
Definition at line 110 of file STK_lapack_Svd.h.
Definition at line 111 of file STK_lapack_Svd.h.
Definition at line 112 of file STK_lapack_Svd.h.
|
inline |
Default constructor.
A | matrix to decompose |
ref | if true , U_ is a reference of A. |
withU | if true save the left Householder transforms in U_ . |
withV | if true save the right Householder transforms in V_ . |
Definition at line 131 of file STK_lapack_Svd.h.
|
inline |
constructor with other kind of array/expression
A | the matrix/expression to decompose. |
withU | if true save the left Householder transforms in U_ . |
withV | if true save the right Householder transforms in V_ . |
Definition at line 139 of file STK_lapack_Svd.h.
Copy constructor.
decomp | the decomposition to copy |
Definition at line 144 of file STK_lapack_Svd.h.
|
inlinevirtual |
clone pattern
Definition at line 148 of file STK_lapack_Svd.h.
|
inlineprivate |
compute the svd decomposition.
a contains either u, vt (if jobz_=='O') or is destroyed at the end of the oputput.
Definition at line 202 of file STK_lapack_Svd.h.
References computeSvd(), STK::IRunnerBase::error(), STK::lapack::gesdd(), jobz_, STK::IRunnerBase::msg_error_, STK::ICArray< Derived >::p_data(), STK::ICArray< Derived >::resize(), STK::ICArray< Derived >::shift(), STKERROR_1ARG, and STKERROR_NO_ARG.
Referenced by computeSvd(), and runImpl().
|
inline |
Definition at line 158 of file STK_lapack_Svd.h.
References jobz_.
Referenced by setJobz().
Operator = : overwrite the Svd with decomp.
Definition at line 150 of file STK_lapack_Svd.h.
References jobz_, and STK::ISvd< Svd >::operator=().
|
inline |
Run svd decomposition.
Definition at line 175 of file STK_lapack_Svd.h.
References _T, computeSvd(), STK::ISvd< Svd >::D_, jobz_, STK::IRunnerBase::msg_error_, STK::transpose(), STK::ISvd< Svd >::U_, and STK::ISvd< Svd >::V_.
|
inline |
|
private |
option
Definition at line 168 of file STK_lapack_Svd.h.
Referenced by computeSvd(), jobz(), operator=(), runImpl(), and setJobz().