- Types of matrices and vectors
- Creating and initializing matrices and vectors
- Copying matrices, vectors, and arrays
- Copying timeseries to matrices and vectors
- Copying tick history to matrices and vectors
- Evaluation of expressions with matrices and vectors
- Manipulating matrices and vectors
- Products of matrices and vectors
- Transformations (decomposition) of matrices
- Obtaining statistics
- Characteristics of matrices and vectors
- Solving equations
- Machine learning methods
Characteristics of matrices and vectors
The following group of methods can be used to obtain the main characteristics of matrices:
- Rows, Cols: the number of rows and columns in the matrix
- Norm: one of the predefined matrix norms (ENUM_MATRIX_NORM)
- Cond: the condition number of the matrix
- Det: the determinant of a square nondegenerate matrix
- SLogDet: calculates the sign and logarithm of the matrix determinant
- Rank: the rank of the matrix
- Trace: the sum of elements along the diagonals of the matrix (trace)
- Spectrum: the spectrum of a matrix as a set of its eigenvalues
In addition, the following characteristics are defined for vectors:
- Size: the length of the vector
- Norm: one of the predefined vector norms (ENUM_VECTOR_NORM)
The sizes of objects (as well as the indexing of elements in them) use values of the ulong type.
ulong matrix<T>::Rows()
ulong matrix<T>::Cols()
ulong vector<T>::Size()
Most of the other characteristics are real numbers.
double vector<T>::Norm(const ENUM_VECTOR_NORM norm, const int norm_p = 2)
double matrix<T>::Norm(const ENUM_MATRIX_NORM norm)
double matrix<T>::Cond(const ENUM_MATRIX_NORM norm)
double matrix<T>::Det()
double matrix<T>::SLogDet(int &sign)
double matrix<T>::Trace()
The rank and spectrum are, respectively, an integer and a vector.
int matrix<T>::Rank()
vector matrix<T>::Spectrum()
Matrix rank calculation example:
matrix a = matrix::Eye(4, 4);
|
And here is the result of the script execution:
matrix a (eye)
|