Matrix and Vector Types
Matrix and vector are special data types in MQL5 which enable linear algebra operations. The following data types exist:
- matrix — a matrix containing double elements.
- matrixf — a matrix containing float elements.
- matrixc — a matrix containing complex elements.
- vector — a vector containing double elements.
- vectorf — a vector containing float elements.
- vectorc — a vector containing complex elements.
Template functions support notations like matrix<double>, matrix<float>, vector<double>, vector<float> instead of the corresponding types.
Matrix and vector initialization methods
Function |
Action |
---|---|
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 |