00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef NUMERICALANALYSIS_H
00022 #define NUMERICALANALYSIS_H
00023
00027
00028 #include <QVVector>
00029 #include <QVMatrix>
00030 #include <QVFunction>
00031
00045 const QVVector qvEstimateGradient( QVFunction<QVVector, double> &function,
00046 const QVVector &point, const double h = 1e-6);
00047
00061 const QVMatrix qvEstimateJacobian( QVFunction<QVVector, QVVector> &function,
00062 const QVVector &point, const double h = 1e-6);
00063
00083 const QVMatrix qvEstimateHessian( QVFunction<QVVector, double> &function,
00084 const QVVector &point, const double h = 1e-3);
00085
00093 enum GSLMinFMinimizer
00094 {
00096 GoldenSection = 0,
00098 BrentMinimization = 1
00099 };
00100
00108 enum GSLMultiminFDFMinimizerType
00109 {
00111 ConjugateFR = 0,
00113 ConjugatePR = 1,
00115 VectorBFGS = 2,
00117 SteepestDescent = 3
00118 };
00119
00127 enum GSLMultiminFDFSolverType
00128 {
00130 LMScaledDerivative = 0,
00131
00133 LMDerivative = 1
00134 };
00135
00201 #ifdef GSL_AVAILABLE
00202 bool qvGSLMinimizeFDF ( const QVFunction<QVVector, double> & function, QVVector &point,
00203 const GSLMultiminFDFMinimizerType gslMinimizerAlgorithm = ConjugateFR,
00204 const int maxIterations = 100, const double maxGradientNorm = 1e-3,
00205 const double step = 0.01, const double tol = 1e-4);
00206 #endif
00207
00296 #ifdef GSL_AVAILABLE
00297 bool qvGSLMinimizeFDF ( const QVFunction<QVVector, double> & function,
00298 const QVFunction<QVVector, QVVector> & gradientFunction,
00299 QVVector &point, const GSLMultiminFDFMinimizerType gslMinimizerAlgorithm = ConjugateFR,
00300 const int maxIterations = 100, const double maxGradientNorm = 1e-3,
00301 const double step = 0.01, const double tol = 1e-4);
00302 #endif
00303
00387 #ifdef GSL_AVAILABLE
00388 bool qvGSLSolveFDF ( const QVFunction<QVVector, QVVector> & function,
00389 const QVFunction<QVVector, QVMatrix> & functionJacobian,
00390 QVVector &x, const GSLMultiminFDFSolverType gslSolverAlgorithm = LMScaledDerivative,
00391 const int maxIterations = 100, const double maxAbsErr = 1e-4, const double maxRelErr = 1e-4
00392 );
00393 #endif
00394
00446 #ifdef GSL_AVAILABLE
00447 bool qvGSLMinimize(const QVFunction<double, double> &function,
00448 double &x, double &lower, double &upper,
00449 const GSLMinFMinimizer gslMinimizerAlgorithm = BrentMinimization,
00450 const int maxIterations = 100,
00451 const double absoluteError = 1e-3,
00452 const double relativeError = 0.0);
00453 #endif
00454 #endif