STK++
0.9.13
tutoMergeArrays2D.cpp
Go to the documentation of this file.
1
#include "
STKpp.h
"
2
using namespace
STK
;
3
int
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
}
stk_cout
#define stk_cout
Standard stk output stream.
Definition
STK_Typedefs.h:73
_T
#define _T(x)
Let x unmodified.
Definition
STK_Typedefs.h:71
STKpp.h
This file include all the header files of the STK++ project.
STK::Array2DVector< Real >
STK::Array2D< Real >
STK::IArray2D::isRef
bool isRef() const
Definition
STK_IArray2D.h:171
STK::IArray2D::merge
void merge(IArray2D< OtherDerived > const &other)
Append the container other to this without copying the data explicitly.
Definition
STK_IArray2D.h:548
STK
The namespace STK is the main domain space of the Statistical ToolKit project.
main
int main(int argc, char *argv[])
Definition
tutoMergeArrays2D.cpp:3
doc
tutorials
programs
tutoMergeArrays2D.cpp
Generated on Sat Feb 15 2025 12:07:01 for STK++ by
1.9.8