STK++ 0.9.13
tutoRemoveRowsAndCols.cpp
Go to the documentation of this file.
1#include "STKpp.h"
2using namespace STK;
3int main(int argc, char *argv[])
4{
5 ArrayXX A(5, 6);
6 Law::Normal law(1.,2.);
7 A.rand(law);
8 stk_cout << _T("A =\n") << A;
9 // Remove 2 columns
10 A.popBackCols(2);
11 // erase two rows in position 1
12 A.eraseRows(1,2);
13 stk_cout << _T("A =\n") << A;
14
15 PointX B(6); B << 1, 2, 3, 4, 5, 6;
16 stk_cout << _T("B =\n") << B;
17 // erase three elements at the position 2
18 B.erase(2,3);
19 stk_cout << _T("B =\n") << B;
20}
#define stk_cout
Standard stk output stream.
#define _T(x)
Let x unmodified.
This file include all the header files of the STK++ project.
void erase(int pos, int n=1)
Delete n elts at the pos index to the container.
Derived & rand(Law::IUnivLaw< Type > const &law)
set random values to this using a distribution law given by the user.
void popBackCols(int n=1)
Delete last columns of the array.
void eraseRows(int pos, int n=1)
Delete n rows at the position pos.
Normal distribution law.
The namespace STK is the main domain space of the Statistical ToolKit project.
int main(int argc, char *argv[])