STK++ 0.9.13
tutoSvd.cpp File Reference
#include <STKpp.h>
Include dependency graph for tutoSvd.cpp:

Go to the source code of this file.

Functions

int main (int argc, char **argv)
 

Function Documentation

◆ main()

int main ( int  argc,
char **  argv 
)

Definition at line 4 of file tutoSvd.cpp.

5{
6 ArrayXX a(5,4), usvt;
7 a << 0, 1, 2, 3,
8 2, 3, 4, 5,
9 2, 1, 6, 7,
10 0, 3,-1, 2,
11 3,-1, 1, 1;
12 stk_cout << _T("STK++ Svd decomposition:\n");
13 stk_cout << _T("------------------------\n");
14 Svd<ArrayXX> s(a); s.run();
15 stk_cout << _T("Singular values:\n");
16 stk_cout << s.D();
17 stk_cout << _T("\nUDV^T matrix:\n");
18 stk_cout << s.U()*s.D()*s.V().transpose();
19 stk_cout << _T("\nlapack Svd decomposition:\n");
20 stk_cout << _T("---------------------------\n");
21 lapack::Svd ls(a); ls.run();
22 stk_cout << _T("Singular values:\n");
23 stk_cout << ls.D().transpose();
24 stk_cout << _T("\nUDV^T matrix:\n");
25 stk_cout << ls.U()*ls.D().diagonalize()*ls.V().transpose();
26 return 0;
27}
#define stk_cout
Standard stk output stream.
#define _T(x)
Let x unmodified.
virtual bool run()
run the computations.
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...

References _T, STK::ISvd< Derived >::D(), STK::ISvd< Derived >::run(), stk_cout, STK::ISvd< Derived >::U(), and STK::ISvd< Derived >::V().