STK++ 0.9.13
tutoAccessors.cpp
Go to the documentation of this file.
1#include "STKpp.h"
2using namespace STK;
3int main(int argc, char** argv)
4{
5 // create a matrix of Real of dynamic size (3,5)
6 Array2D<Real> a(3, 4); a << 1.,2.,3.,4.
7 , 1.,2.,3.,4.
8 , 1.,1.,1.,1.;
9 std::cout << "a=\n" << a;
10 // create a vector of Real of dynamic size 3 with all coefficients equal to 0
11 Array2DVector<Real> b(3, 0);
12 b[2] = 1.;
13 std::cout << "b=\n" << b;
14 // create an unitialized CArray of Real of fixed size (3,4)
16 // create a CArray of Real of dynamic size (3,4) with initial value -2.
17 CArray<Real> d(3, 4, -2.);
18 // compute c = -a - d + 3 (Id)
19 c= -a - d + 3.; c(2,2) = 5.;
20 std::cout << "c=\n" << c;
21 // create an unitialized CVector of Real of fixed size 3
23 e = -2.; e[1] = 5.;
24 std::cout << "e=\n" << e;
25 // create an initialized CPoint of Real of fixed size 3
27 f = -2.; f[1] = 5.;
28 std::cout << "f= " << f;
29 return 0;
30}
This file include all the header files of the STK++ project.
template one dimensional horizontal Array.
template two dimensional column (vertically) oriented Array.
declaration of the point case.
specialization for the vector case.
A CArray is a two dimensional array with a continuous storage like a C-array.
Definition STK_CArray.h:130
The namespace STK is the main domain space of the Statistical ToolKit project.
int main(int argc, char **argv)