STK++ 0.9.13
tutoVisitors.cpp
Go to the documentation of this file.
1#include "STKpp.h"
2using namespace STK;
4int main(int argc, char** argv)
5{
6 CArray22 a;
7 a << 0, 1,
8 2, 3;
9 stk_cout << "a.sum()= " << a.sum() << _T("\n");
10 stk_cout << "a.minElt()= " << a.minElt() << _T("\n");
11 stk_cout << "a.maxElt()= " << a.maxElt() << _T("\n");
12 stk_cout << "(a > 0).count()= " << (a > 0).count() << _T("\n");
13 stk_cout << "(a > 0).all()= " << (a > 0).all() << _T("\n");
14 stk_cout << "(a > 0).any()= " << (a > 0).any() << _T("\n");
15 int i,j;
16 stk_cout << "a.minElt(i,j)= " << a.minElt(i,j) << _T("\n");
17 stk_cout << "i= " << i << ", j= " << j << _T("\n");
18 return 0;
19}
#define stk_cout
Standard stk output stream.
#define _T(x)
Let x unmodified.
This file include all the header files of the STK++ project.
A CArray is a two dimensional array with a continuous storage like a C-array.
Definition STK_CArray.h:130
Type const sum() const
Type const maxElt(int &row, int &col) const
Type const minElt(int &row, int &col) const
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::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...
The namespace STK is the main domain space of the Statistical ToolKit project.
int main(int argc, char **argv)