STK++ 0.9.13
tutoCenteringAnArray.cpp File Reference
#include "STKpp.h"
Include dependency graph for tutoCenteringAnArray.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 3 of file tutoCenteringAnArray.cpp.

4{
5 CArrayXX A(100, 5);
6 Law::Normal law(1,2);
7 A.rand(law);
8 // call column statistical functions
9 stk_cout << _T("min(A) =") << Stat::min(A);
10 stk_cout << _T("max(A) =") << Stat::max(A);
11 stk_cout << _T("max(A.abs()) =") << Stat::max(A.abs());
12 stk_cout << _T("mean(A) =") << Stat::mean(A);
13 // center the array
14 stk_cout << _T("\nCentering...\n\n");
15 A -= Const::VectorX(100) * Stat::mean(A);
16 // call column statistical functions with all the columns of A centered
17 stk_cout << _T("min(A) =") << Stat::min(A);
18 stk_cout << _T("max(A) =") << Stat::max(A);
19 stk_cout << _T("max(A.abs()) =") << Stat::max(A.abs());
20 stk_cout << _T("mean(A) =") << Stat::mean(A);
21}
#define stk_cout
Standard stk output stream.
#define _T(x)
Let x unmodified.
Normal distribution law.
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
hidden::FunctorTraits< Derived, MaxOp >::Row max(Derived const &A)
Compute the maximal(s) value(s) of A.
hidden::FunctorTraits< Derived, MeanOp >::Row mean(Derived const &A)
Compute the mean(s) value(s) of A.
hidden::FunctorTraits< Derived, MinOp >::Row min(Derived const &A)
Compute the minimal(s) value(s) of A.
Vector< Real, UnknownSize > VectorX

References _T, STK::ExprBase< Derived >::abs(), STK::Stat::max(), STK::Stat::mean(), STK::Stat::min(), STK::ArrayBase< Derived >::rand(), and stk_cout.