//+------------------------------------------------------------------+ //| matrix.mqh | //| Copyright 2003-2012 Sergey Bochkanov (ALGLIB project) | //| Copyright 2012-2017, MetaQuotes Software Corp. | //| https://www.mql5.com | //+------------------------------------------------------------------+ //| Implementation of ALGLIB library in MetaQuotes Language 5 | //| | //| The features of the library include: | //| - Linear algebra (direct algorithms, EVD, SVD) | //| - Solving systems of linear and non-linear equations | //| - Interpolation | //| - Optimization | //| - FFT (Fast Fourier Transform) | //| - Numerical integration | //| - Linear and nonlinear least-squares fitting | //| - Ordinary differential equations | //| - Computation of special functions | //| - Descriptive statistics and hypothesis testing | //| - Data analysis - classification, regression | //| - Implementing linear algebra algorithms, interpolation, etc. | //| in high-precision arithmetic (using MPFR) | //| | //| This file is free software; you can redistribute it and/or | //| modify it under the terms of the GNU General Public License as | //| published by the Free Software Foundation (www.fsf.org); either | //| version 2 of the License, or (at your option) any later version. | //| | //| This program is distributed in the hope that it will be useful, | //| but WITHOUT ANY WARRANTY; without even the implied warranty of | //| MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | //| GNU General Public License for more details. | //+------------------------------------------------------------------+ #include "complex.mqh" #include "arrayresize.mqh" //+------------------------------------------------------------------+ //| Rows (double) | //+------------------------------------------------------------------+ class CRowDouble { private: double m_array[]; public: CRowDouble(void); ~CRowDouble(void); //--- methods int Size(void) const; void Resize(const int n); void Set(const int i,const double d); //--- overloading double operator[](const int i) const; void operator=(const double &array[]); void operator=(const CRowDouble &r); }; //+------------------------------------------------------------------+ //| Constructor without parameters | //+------------------------------------------------------------------+ CRowDouble::CRowDouble(void) { } //+------------------------------------------------------------------+ //| Destructor | //+------------------------------------------------------------------+ CRowDouble::~CRowDouble(void) { } //+------------------------------------------------------------------+ //| Row size | //+------------------------------------------------------------------+ int CRowDouble::Size(void) const { return(ArraySize(m_array)); } //+------------------------------------------------------------------+ //| Resize | //+------------------------------------------------------------------+ void CRowDouble::Resize(const int n) { ArrayResizeAL(m_array,n); } //+------------------------------------------------------------------+ //| Set value | //+------------------------------------------------------------------+ void CRowDouble::Set(const int i,const double d) { m_array[i]=d; } //+------------------------------------------------------------------+ //| Indexing operator | //+------------------------------------------------------------------+ double CRowDouble::operator[](const int i) const { return(m_array[i]); } //+------------------------------------------------------------------+ //| Overloading (=) | //+------------------------------------------------------------------+ void CRowDouble::operator=(const double &array[]) { int size=ArraySize(array); //--- check if(size==0) return; //--- filling array ArrayResizeAL(m_array,size); for(int i=0;i