STK++ 0.9.13
tutoAddingRows.cpp File Reference
#include "STKpp.h"
Include dependency graph for tutoAddingRows.cpp:

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 3 of file tutoAddingRows.cpp.

4{
5 ArrayXX A(Range(0,2), 4);
6 Law::Normal law(1.,2.);
7 A.rand(law);
8 stk_cout << _T("A =\n") << A;
9 // Adding a column with 1
10 A.pushFrontRows(Const::PointX(4));
11 // Insert 2 uninitialize rows at place 2
12 A.insertRows(2, 2);
13 // Set x^2 and x^3 with x in row 1
14 A.row(2) = A.row(1).square();
15 A.row(3) = A.row(1).cube();
16 // Add 2 unitialized rows
17 A.pushBackRows(2);
18 // Set x^2 and x^3 with x in row 4
19 A.row(5) = A.row(4).square();
20 A.row(6) = A.row(4).cube();
21 stk_cout << _T("A =\n") << A;
22
23 PointX B(4); B << 1, 3, 5, 6;
24 stk_cout << _T("B =\n") << B;
25 // insert an unitialized element at place 2
26 B.insertElt(2); B[2] = 3; // set value to 3
27 stk_cout << _T("B =\n") << B;
28}
#define stk_cout
Standard stk output stream.
#define _T(x)
Let x unmodified.
Define the constant point.
Normal distribution law.
The MultidimRegression class allows to regress a multidimensional output variable among a multivariat...
TRange< UnknownSize > Range
Definition STK_Range.h:59

References _T, STK::Array2DPoint< Type_ >::insertElt(), STK::IArray2D< Derived >::insertRows(), STK::IArray2D< Derived >::pushBackRows(), STK::IArray2D< Derived >::pushFrontRows(), STK::ArrayBase< Derived >::rand(), STK::IArray2D< Derived >::row(), and stk_cout.