|
Initialization
There are several ways to declare and initialize matrices and vectors.
Function |
Action |
---|---|
Copies a matrix, vector or array with auto cast |
|
Get the data of the specified indicator buffer in the specified quantity to a vector |
|
Gets the historical series of the MqlRates structure of the specified symbol-period in the specified amount into a matrix or vector |
|
Get ticks from an MqlTick structure into a matrix or a vector |
|
Get ticks from an MqlTick structure into a matrix or a vector within the specified date range |
|
Return a matrix with ones on the diagonal and zeros elsewhere |
|
Create an identity matrix of the specified size |
|
Create and return a new matrix filled with ones |
|
Create and return a new matrix filled with zeros |
|
Create and return a new matrix filled with given value |
|
Construct a matrix with ones at and below the given diagonal and zeros elsewhere |
|
Initialize a matrix or a vector |
|
Fill an existing matrix or vector with the specified value |
Declaration without specifying the size (no memory allocation for the data):
matrix matrix_a; // double type matrix
|
Declaration with the specified size (with memory allocation for the data, but without any initialization):
matrix matrix_a(128,128); // the parameters can be either constants
|
Declaration with initialization (matrix and vector sizes are determined by the initializing sequence):
matrix matrix_a={{0.1,0.2,0.3},{0.4,0.5,0.6}};
|
Declaration with initialization:
template<typename T>
|
Please note that the matrix or vector dimensions can be changed, since the memory for data is always dynamic.
Static methods
Static methods for creating matrices and vectors of the specified size, initialized in a certain way:
matrix matrix_a =matrix::Eye(4,5,1);
|
Methods for initializing already created matrices and vectors:
matrix matrix_a;
|