STK++ 0.9.13
tutoMergeArrays2D.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(3, 2), B(3, 3);
6 A << 1, 2, 3, 4, 5, 6; B << 1, 2, 3, 4, 5, 6, 7, 8, 9;
7 stk_cout << _T("B.isRef() = ") << B.isRef() << _T('\n');
8 // merge B with A
9 A.merge(B);
10 stk_cout << _T("A =\n") << A << _T('\n');
11 stk_cout << _T("B.isRef() = ") << B.isRef() << _T('\n');
12 stk_cout << _T("B =\n") << B<< _T('\n');
13 // merge C with A
14 VectorX C(3); C << 4, 5, 6;
15 A.merge(C);
16 stk_cout << _T("A =\n") << A << _T('\n');
17 // B has been invalidate by A.merge(C) and cannot be used anymore
18 // stk_cout << _T("B =\n") << B; produce an error at execution
19 stk_cout << _T("C.isRef() = ") << C.isRef() << _T('\n');
20 stk_cout << _T("C =\n") << C;
21}
#define stk_cout
Standard stk output stream.
#define _T(x)
Let x unmodified.
This file include all the header files of the STK++ project.
bool isRef() const
void merge(IArray2D< OtherDerived > const &other)
Append the container other to this without copying the data explicitly.
The namespace STK is the main domain space of the Statistical ToolKit project.
int main(int argc, char *argv[])