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

5{
6 CArray2X a(2,4);
7 a << 0, 1, 2, 3
8 , 4, 5, 6, 7;
9 stk_cout << "min(a) = " << min(a);
10 stk_cout << "minByRow(a) = " << minByRow(a);
11 stk_cout << "mean(a) = " << mean(a);
12 stk_cout << "count(a > 0)= " << count(a > 0);
13 stk_cout << "all(a > 0) = " << all(a > 0);
14 stk_cout << "any(a > 0) = " << any(a > 0);
15 a(1,1) = a(1,3) = Arithmetic<Real>::NA();
16 stk_cout << "count(a.isNA())= " << count(a.isNA());
17 stk_cout << "countByRow(a.isNA())= " << countByRow(a.isNA());
18 return 0;
19}
#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
hidden::SliceVisitorSelector< Derived, hidden::MeanVisitor, Arrays::by_col_ >::type_result mean(Derived const &A)
If A is a row-vector or a column-vector then the function will return the usual mean value of the vec...
hidden::SliceVisitorSelector< Derived, hidden::CountVisitor, Arrays::by_col_ >::type_result count(Derived const &A)
If A is a row-vector or a column-vector then the function will return the usual count value of the ve...
hidden::SliceVisitorSelector< Derived, hidden::MinVisitor, Arrays::by_col_ >::type_result min(Derived const &A)
If A is a row-vector or a column-vector then the function will return the usual minimal value of the ...
hidden::SliceVisitorSelector< Derived, hidden::AnyVisitor, Arrays::by_col_ >::type_result any(Derived const &A)
If A is a row-vector or a column-vector then the function will return the usual visitor value of the ...
hidden::SliceVisitorSelector< Derived, hidden::AllVisitor, Arrays::by_col_ >::type_result all(Derived const &A)
If A is a row-vector or a column-vector then the function will return the usual all value of the vect...
hidden::SliceVisitorSelector< Derived, hidden::MinVisitor, Arrays::by_row_ >::type_result minByRow(Derived const &A)
hidden::SliceVisitorSelector< Derived, hidden::CountVisitor, Arrays::by_row_ >::type_result countByRow(Derived const &A)
static Type NA()
Adding a Non Available (NA) special number.

References STK::all(), STK::any(), STK::count(), STK::countByRow(), STK::ExprBase< Derived >::isNA(), STK::mean(), STK::min(), STK::minByRow(), STK::Arithmetic< Type >::NA(), and stk_cout.