AlgLib_ver3.19/TestClasses.3.5.mq5
super.admin 9e263d779c convert
2025-05-30 14:39:48 +02:00

823 lines
32 KiB
MQL5

//+------------------------------------------------------------------+
//| testclasses.mq5 |
//| Copyright 2003-2012 Sergey Bochkanov (ALGLIB project) |
//| Copyright 2000-2023, MetaQuotes Ltd. |
//| https://www.mql5.com |
//+------------------------------------------------------------------+
//| Implementation of ALGLIB library in MetaQuotes Language 5 (MQL5) |
//| |
//| The features of the ALGLIB 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) |
//| |
//| If you find any functional differences between ALGLIB for MQL5 |
//| and the original ALGLIB project (www.alglib.net), please contact |
//| developers of MQL5 on the Forum at www.mql5.com. |
//| |
//| You can report bugs found in the computational algorithms of the |
//| ALGLIB library by notifying the ALGLIB project coordinators |
//| at http://www.alglib.net. |
//+------------------------------------------------------------------+
//| SOURCE LICENSE |
//| |
//| This program 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. |
//| |
//| A copy of the GNU General Public License is available at |
//| http://www.fsf.org/licensing/licenses |
//+------------------------------------------------------------------+
#include "TestClasses.3.5.mqh"
//+------------------------------------------------------------------+
//| |
//+------------------------------------------------------------------+
class CSpeedMeter
{
ulong m_cntr;
public:
CSpeedMeter():m_cntr(0) {}
~CSpeedMeter() {}
void Start() { m_cntr=GetMicrosecondCount(); }
uint Stop() { return(uint(GetMicrosecondCount()-m_cntr)); }
}
s_meter;
int ErrCnt=0;
//+------------------------------------------------------------------+
//| Testing script |
//+------------------------------------------------------------------+
int OnStart()
{
ulong test_time=GetMicrosecondCount();
//--- create variables
uint seed;
//--- setting this option to generate random numbers
_RandomSeed=GetTickCount();
//--- start time
Print(TimeLocal());
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestHQRndUnit::TestHQRnd(true))
PrintFormat("CHighQualityRand: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CHighQualityRand: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestHQRndUnit::TestHQRnd(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestTSortUnit::TestTSort(true))
PrintFormat("CTSort: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CTSort: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestTSortUnit::TestTSort(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestNearestNeighborUnit::TestNearestNeighbor(true))
PrintFormat("CNearestNeighbor: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CNearestNeighbor: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestNearestNeighborUnit::TestNearestNeighbor(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestAblasUnit::TestAblas(true))
PrintFormat("CAblas: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CAblas: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestAblasUnit::TestAblas(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestBaseStatUnit::TestBaseStat(true))
PrintFormat("CBaseStat: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CBaseStat: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestBaseStatUnit::TestBaseStat(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestBdSSUnit::TestBdSS(true))
PrintFormat("CBdSS: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CBdSS: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestBdSSUnit::TestBdSS(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestDForestUnit::TestDForest(true))
PrintFormat("CDForest: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CDForest: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestDForestUnit::TestDForest(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestBlasUnit::TestBlas(true))
PrintFormat("CBlas: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CBlas: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestBlasUnit::TestBlas(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestKMeansUnit::TestKMeans(true))
PrintFormat("CKMeans: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CKMeans: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestKMeansUnit::TestKMeans(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestHblasUnit::TestHblas(true))
PrintFormat("CHblas: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CHblas: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestHblasUnit::TestHblas(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestReflectionsUnit::TestReflections(true))
PrintFormat("CReflections: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CReflections: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestReflectionsUnit::TestReflections(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestCReflectionsUnit::TestCReflections(true))
PrintFormat("CComplexReflections: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CComplexReflections: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestCReflectionsUnit::TestCReflections(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestSblasUnit::TestSblas(true))
PrintFormat("CSblas: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CSblas: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestSblasUnit::TestSblas(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestOrtFacUnit::TestOrtFac(true))
PrintFormat("COrtFac: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("COrtFac: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestOrtFacUnit::TestOrtFac(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestEVDUnit::TestEVD(true))
PrintFormat("CEigenVDetect: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CEigenVDetect: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestEVDUnit::TestEVD(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestMatGenUnit::TestMatGen(true))
PrintFormat("CMatGen: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CMatGen: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestMatGenUnit::TestMatGen(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestTrFacUnit::TestTrFac(true))
PrintFormat("CTrFac: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CTrFac: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestTrFacUnit::TestTrFac(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestTrLinSolveUnit::TestTrLinSolve(true))
PrintFormat("CTrLinSolve: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CTrLinSolve: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestTrLinSolveUnit::TestTrLinSolve(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestSafeSolveUnit::TestSafeSolve(true))
PrintFormat("CSafeSolve: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CSafeSolve: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestSafeSolveUnit::TestSafeSolve(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestRCondUnit::TestRCond(true))
PrintFormat("CRCond: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CRCond: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestRCondUnit::TestRCond(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestMatInvUnit::TestMatInv(true))
PrintFormat("CMatInv: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CMatInv: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestMatInvUnit::TestMatInv(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestLDAUnit::TestLDA(true))
PrintFormat("CLDA: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CLDA: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestLDAUnit::TestLDA(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestGammaFuncUnit::TestGammaFunc(true))
PrintFormat("CGammaFunc: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CGammaFunc: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestGammaFuncUnit::TestGammaFunc(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestBdSVDUnit::TestBdSVD(true))
PrintFormat("CBdSingValueDecompose: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CBdSingValueDecompose: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestBdSVDUnit::TestBdSVD(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestSVDUnit::TestSVD(true))
PrintFormat("CSingValueDecompose: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CSingValueDecompose: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestSVDUnit::TestSVD(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestLinRegUnit::TestLinReg(true))
PrintFormat("CLinReg: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CLinReg: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestLinRegUnit::TestLinReg(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestXBlasUnit::TestXBlas(true))
PrintFormat("CXblas: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CXblas: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestXBlasUnit::TestXBlas(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestDenseSolverUnit::TestDenseSolver(true))
PrintFormat("CDenseSolver: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CDenseSolver: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestDenseSolverUnit::TestDenseSolver(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestLinMinUnit::TestLinMin(true))
PrintFormat("CLinMin: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CLinMin: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestLinMinUnit::TestLinMin(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestMinCGUnit::TestMinCG(true))
PrintFormat("CMinCG: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CMinCG: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestMinCGUnit::TestMinCG(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestMinBLEICUnit::TestMinBLEIC(true))
PrintFormat("CMinBLEIC: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CMinBLEIC: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestMinBLEICUnit::TestMinBLEIC(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestMCPDUnit::TestMCPD(true))
PrintFormat("CMarkovCPD: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CMarkovCPD: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestMCPDUnit::TestMCPD(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestFblsUnit::TestFbls(true))
PrintFormat("CFbls: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CFbls: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestFblsUnit::TestFbls(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestMinLBFGSUnit::TestMinLBFGS(true))
PrintFormat("CMinLBFGS: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CMinLBFGS: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestMinLBFGSUnit::TestMinLBFGS(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestMLPTrainUnit::TestMLPTrain(true))
PrintFormat("CMLPTrain: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CMLPTrain: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestMLPTrainUnit::TestMLPTrain(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestMLPEUnit::TestMLPE(true))
PrintFormat("CMLPE: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CMLPE: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestMLPEUnit::TestMLPE(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestPCAUnit::TestPCA(true))
PrintFormat("CPCAnalysis: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CPCAnalysis: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestPCAUnit::TestPCA(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestODESolverUnit::TestODESolver(true))
PrintFormat("CODESolver: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CODESolver: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestODESolverUnit::TestODESolver(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestFFTUnit::TestFFT(true))
PrintFormat("CFastFourierTransform: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CFastFourierTransform: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestFFTUnit::TestFFT(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestConvUnit::TestConv(true))
PrintFormat("CConv: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CConv: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestConvUnit::TestConv(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestCorrUnit::TestCorr(true))
PrintFormat("CCorr: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CCorr: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestCorrUnit::TestCorr(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestFHTUnit::TestFHT(true))
PrintFormat("CFastHartleyTransform: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CFastHartleyTransform: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestFHTUnit::TestFHT(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestGQUnit::TestGQ(true))
PrintFormat("CGaussQ: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CGaussQ: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestGQUnit::TestGQ(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestGKQUnit::TestGKQ(true))
PrintFormat("CGaussKronrodQ: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CGaussKronrodQ: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestGKQUnit::TestGKQ(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestAutoGKUnit::TestAutoGK(true))
PrintFormat("CAutoGK: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CAutoGK: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestAutoGKUnit::TestAutoGK(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestIDWIntUnit::TestIDWInt(true))
PrintFormat("CIDWInt: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CIDWInt: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestIDWIntUnit::TestIDWInt(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestRatIntUnit::TestRatInt(true))
PrintFormat("CRatInt: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CRatInt: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestRatIntUnit::TestRatInt(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestPolIntUnit::TestPolInt(true))
PrintFormat("CPolInt: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CPolInt: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestPolIntUnit::TestPolInt(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestSpline1DUnit::TestSpline1D(true))
PrintFormat("CSpline1D: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CSpline1D: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestSpline1DUnit::TestSpline1D(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestMinLMUnit::TestMinLM(true))
PrintFormat("CMinLM: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CMinLM: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestMinLMUnit::TestMinLM(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestLSFitUnit::TestLSFit(true))
PrintFormat("CLSFit: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CLSFit: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestLSFitUnit::TestLSFit(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestPSplineUnit::TestPSpline(true))
PrintFormat("CPSpline: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CPSpline: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestPSplineUnit::TestPSpline(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestSpline2DUnit::TestSpline2D(true))
PrintFormat("CSpline2D: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CSpline2D: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestSpline2DUnit::TestSpline2D(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestSpdGEVDUnit::TestSpdGEVD(true))
PrintFormat("CSpdGEVD: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CSpdGEVD: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestSpdGEVDUnit::TestSpdGEVD(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestInverseUpdateUnit::TestInverseUpdate(true))
PrintFormat("CInverseUpdate: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CInverseUpdate: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestInverseUpdateUnit::TestInverseUpdate(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestSchurUnit::TestSchur(true))
PrintFormat("CSchur: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CSchur: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestSchurUnit::TestSchur(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestNlEqUnit::TestNlEq(true))
PrintFormat("CNlEq: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CNlEq: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestNlEqUnit::TestNlEq(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestChebyshevUnit::TestChebyshev(true))
PrintFormat("CChebyshev: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CChebyshev: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestChebyshevUnit::TestChebyshev(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestHermiteUnit::TestHermite(true))
PrintFormat("CHermite: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CHermite: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestHermiteUnit::TestHermite(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestLaguerreUnit::TestLaguerre(true))
PrintFormat("CLaguerre: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CLaguerre: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestLaguerreUnit::TestLaguerre(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestLegendreUnit::TestLegendre(true))
PrintFormat("CLegendre: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("CLegendre: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestLegendreUnit::TestLegendre(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- check class
seed=_RandomSeed; s_meter.Start();
if(CTestAlglibBasicsUnit::TestAlglibBasics(true))
PrintFormat("AlglibBasics: OK in %d mcs",s_meter.Stop());
else
{
Print("----------------------------------------");
PrintFormat("AlglibBasics: FAILED in %d mcs (seed=%d)",s_meter.Stop(),seed); _RandomSeed=seed;
CTestAlglibBasicsUnit::TestAlglibBasics(false);
Print("----------------------------------------");
ErrCnt++;
}
//--- finish time
Print(TimeLocal(),", test time: ",(GetMicrosecondCount()-test_time)/1000.0," msec");
//---
return(ErrCnt);
}
//+------------------------------------------------------------------+