STK++ 0.9.13
tutoRowsAndCols.cpp
Go to the documentation of this file.
1#include "STKpp.h"
2using namespace STK;
3int main(int argc, char *argv[])
4{
5 CArrayXX A(4, 6); CArray2X B(2,4, -1.);
6 A << 1, 2, 3, 4, 1, 2,
7 4, 3, 1, 3, 2, 4,
8 1, 3, 4, 2, 1, 4,
9 2, 3, 1, 4, 3, 2;
10 stk_cout << _T("A =\n") << A;
11 stk_cout << _T("B =\n") << B;
12 A.sub(B.rows(), B.cols()) = B; // copy B in A(0:1,0:3)
13 stk_cout << _T("A =\n") << A;
14 A.row(3,B.cols()) = meanByCol(B); // copy a row-vector in row 3 of A
15 stk_cout << _T("A =\n") << A;
16}
#define stk_cout
Standard stk output stream.
#define _T(x)
Let x unmodified.
This file include all the header files of the STK++ project.
hidden::CSlice< Derived, 1, sizeCols_ >::Result row(int i) const
implement the row operator using a reference on the row of the allocator
hidden::CSliceDispatcher< Derived, Size >::Result sub(TRange< Size > const &J) const
implement the sub operator for 1D arrays using a reference on the row/column of the allocator
The namespace STK is the main domain space of the Statistical ToolKit project.
hidden::SliceVisitorSelector< Derived, hidden::MeanVisitor, Arrays::by_col_ >::type_result meanByCol(Derived const &A)
int main(int argc, char *argv[])