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

4{
5 CArray3X a(3,5); a.randGauss();
6 stk_cout << "Stat::mean(a)=\n" << Stat::mean(a);
7 stk_cout << "Stat::meanByRow(a)=\n"<< Stat::meanByRow(a);
8 stk_cout << "Stat::variance(a)=\n" << Stat::variance(a);
9 // compute the biased variance (divided by N=3) with mean fixed to 0
10 stk_cout << "Stat::varianceWithFixedMean(a,0,false)=\n"
12 a(1,2) = a(2,2) = Arithmetic<Real>::NA();
13 stk_cout << "Stat::meanSafe(a)=\n" << Stat::meanSafe(a);
14 stk_cout << "Stat::meanSafeByRow(a)=\n" << Stat::meanSafeByRow(a);
15 return 0;
16}
#define stk_cout
Standard stk output stream.
A CArray is a two dimensional array with a continuous storage like a C-array.
Definition STK_CArray.h:130
Define the constant point.
hidden::FunctorTraits< Derived, VarianceWithFixedMeanOp >::Row varianceWithFixedMean(Derived const &A, MeanType const &mean, bool unbiased)
Compute the VarianceWithFixedMean(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, VarianceOp >::Row variance(Derived const &A, bool unbiased=false)
Compute the variance(s) value(s) of A.
hidden::FunctorTraits< Derived, MeanSafeOp >::Row meanSafe(Derived const &A)
Compute safely the mean(s) value(s) of A.
hidden::FunctorTraits< Derived, MeanSafeOp >::Col meanSafeByRow(Derived const &A)
hidden::FunctorTraits< Derived, MeanOp >::Col meanByRow(Derived const &A)
static Type NA()
Adding a Non Available (NA) special number.

References STK::Stat::mean(), STK::Stat::meanByRow(), STK::Stat::meanSafe(), STK::Stat::meanSafeByRow(), STK::Arithmetic< Type >::NA(), STK::ArrayBase< Derived >::randGauss(), stk_cout, STK::Stat::variance(), and STK::Stat::varianceWithFixedMean().