- Added new OpenBLAS methods:
Matrix Reductions
- ReduceToHessenberg — reduces a real or complex general n-by-n matrix A to upper Hessenberg form B by an orthogonal similarity transformation: Q**T * A * Q = H. LAPACK function GEHRD.
- ReflectHessenbergToQ — generates orthogonal matrix Q which is defined as the product of n-1 elementary reflectors of order n, as returned by ReduceToHessenberg: Q = H(1) H(2) . . . H(n-1). LAPACK function ORGHR.
Eigenvalues and Eigenvectors
- EigenHessenbergSchurQ — computes the eigenvalues of a Hessenberg matrix H and the matrices T and Z from the Schur decomposition H = Z T Z**T, where T is an upper quasi-triangular matrix (the Schur form), and Z is the orthogonal matrix of Schur vectors. LAPACK function HSEQR.
Linear Equations
- SylvesterEquationTriangular — solves Sylvester equation for real quasi-triangular or complex triangular matrices: op(A)*X + X*op(B) = scale*C or op(A)*X - X*op(B) = scale*C where op(A) = A or A**T or A**H, and A and B are both upper triangular. LAPACK function TRSYL.
- SylvesterEquationTriangularBlocked — solves Sylvester equation for real quasi-triangular or complex triangular matrices: op(A)*X + X*op(B) = scale*C or op(A)*X - X*op(B) = scale*C where op(A) = A or A**T or A**H, and A and B are both upper triangular. LAPACK function TRSYL3. This is the block (BLAS level 3) version of TRSYL. Faster up to 5 times but not so accurate.
Factored Calculations
- SylvesterEquationSchur — solves Sylvester equation for real quasi-triangular or complex triangular matrices: A*X + X*B = C where A and B are both upper triangular. A is m-by-m and B is n-by-n; the right hand side C and the solution X are m-by-n. LAPACK function TRSYL.
- SylvesterEquationSchurBlocked — solves Sylvester equation for real quasi-triangular or complex triangular matrices: A*X + X*B = C where A and B are both upper triangular. A is m-by-m and B is n-by-n; the right hand side C and the solution X are m-by-n. LAPACK function TRSYL3. This is the block (BLAS level 3) version of TRSYL. Faster up to 5 times but not so accurate.
Matrix Norm Calculations
- MatrixNorm — returns the value of the 1-norm, infinity-norm, Frobenius norm, or the largest absolute value of any element of a general rectangular matrix. LAPACK function LANGE.
- MatrixNormGeTrid — returns the value of the 1-norm, infinity-norm, Frobenius norm, or the largest absolute value of any element of a general tridiagonal matrix. LAPACK function LANGT.
- MatrixNormHessenberg — returns the value of the 1-norm, infinity-norm, Frobenius norm, or the largest absolute value of any element of an upper Hessenberg matrix. LAPACK function LANHS.
- MatrixNormSy — returns the value of the 1-norm, infinity-norm, Frobenius norm, or the largest absolute value of any element of a real symmetric or complex Hermitian matrix. LAPACK functions LANSY, LANHE.
- MatrixNormComplexSy — returns the value of the 1-norm, infinity-norm, Frobenius norm, or the largest absolute value of any element of a complex symmetric (not Hermitian) matrix. LAPACK function LANSY.
- MatrixNormSyTrid — returns the value of the 1-norm, infinity-norm, Frobenius norm, or the largest absolute value of any element of a real symmetric or complex Hermitian tridiagonal matrix. LAPACK functions LANST, LANHT.
- MatrixNormTriangular — returns the value of the 1-norm, infinity-norm, Frobenius norm, or the largest absolute value of any element of a trapezoidal m-by-n or triangular matrix. LAPACK function LANTR.
Matrix Classification
- IsSymmetric — checks if a square matrix is symmetric.
- IsHermitian — checks if a square complex matrix is Hermitian.
- IsUpperTriangular — checks if a square matrix is upper triangular.
- IsLowerTriangular — checks if a square matrix is lower triangular.
- IsTrapezoidal — checks if a rectangular (not square) m-by-n matrix is upper or lower trapezoidal.
- IsUpperHessenberg — checks if a square matrix is upper Hessenberg matrix.
- IsLowerHessenberg — checks if a square matrix is lower Hessenberg matrix.
- IsTridiagonal — checks if a square matrix is tridiagonal.
- IsUpperBidiagonal — checks if a square matrix is upper bidiagonal.
- IsLowerBidiagonal — checks if a square matrix is lower bidiagonal.
- IsDiagonal — checks if a square matrix is diagonal.
- IsScalar — checks if a square matrix is scalar matrix.
- Added the Conjugate method for complex matrices and vectors. This method changes the sign of the imaginary part of a complex number and returns the modified matrix or vector.
- Strengthened method hiding rules. When a derived class contains a method with the same name as one in the base class, the derived class version is now called by default. To explicitly call the base class method, a qualifier is now required:
struct A
{
int y;
string func(double x)
{
return(__FUNCSIG__);
}
};
struct B : public A
{
string func(int x)
{
return(__FUNCSIG__);
}
};
void OnStart(void)
{
B b;
b.func(M_PI);
b.A::func(M_PI);
}
This change simplifies code readability and eliminates ambiguity that was previously only accompanied by a compiler warning.
Previously, compilation would issue a warning:
deprecated behavior, hidden method calling will be disabled in a future MQL compiler version
This change has now taken effect.
For a number of builds, a warning will still appear in the log if a more suitable hidden method is available based on the parameters:
call resolves to 'string B::func(int)' instead of 'string A::func(double)' due to new rules of method hiding
see declaration of function 'B::func'
see declaration of function 'A::func'
truncation of constant value from 'double(3.141592653589793)' to 'int(3)'
- Duplicate names within the same scope are now prohibited. For example, it was previously possible to declare an input parameter and a function with the same name within a single file. Such duplication is no longer allowed:
input int somename=42;
int somename(int x)
{
return(42);
}
- Added strict type checking for default values in enumerations. For function parameters accepting an enum, not only the value but also the exact type must now match:
int somename(ENUM_TIMEFRAMES TF=PERIOD_CURRENT);
int somename(ENUM_TIMEFRAMES TF=0)
{
return(42);
}
- Identical identifiers are now prohibited across different enumerations. An identifier declared in one enumeration can no longer be reused in another within the same scope:
enum A
{
Value
};
enum B
{
Value
};
void OnStart(void)
{
enum C
{
Value
};
}
Matching names can be used in different scopes.
- Introduced stricter requirements for template initializer functions. When creating matrices/vectors using initializer functions, the following features are now disabled:
- Automatic type deduction in template functions
- Default parameter values
All template parameters and arguments must now be specified explicitly:
template<typename T>
void Initializer(matrix<T>& mat,int method=0);
matrix<double> A(10,10,Initializer,42);
matrix<double> A(10,10,Initializer<double>);
matrix<double> A(10,10,Initializer<double>,42);
- Improved ONNX support. Added implicit conversion of signed types when passing ulong arrays to functions, simplifying MQL5 integration with ONNX models.
OnnxSetInputShape( … , ulong_array );
OnnxSetOutputShape( … , ulong_array );
- Fixed display of types in compiler warnings related to implicit string conversions.
- Updated Python integration package. To install the update, run the command:
pip install --upgrade MetaTrader5