| interpolation.h | | interpolation.h | |
| | | | |
| skipping to change at line 101 | | skipping to change at line 101 | |
| double taskrcond; | | double taskrcond; | |
| double rmserror; | | double rmserror; | |
| double avgerror; | | double avgerror; | |
| double avgrelerror; | | double avgrelerror; | |
| double maxerror; | | double maxerror; | |
| } spline1dfitreport; | | } spline1dfitreport; | |
| typedef struct | | typedef struct | |
| { | | { | |
| double taskrcond; | | double taskrcond; | |
| ae_int_t iterationscount; | | ae_int_t iterationscount; | |
|
| | | ae_int_t varidx; | |
| double rmserror; | | double rmserror; | |
| double avgerror; | | double avgerror; | |
| double avgrelerror; | | double avgrelerror; | |
| double maxerror; | | double maxerror; | |
| double wrmserror; | | double wrmserror; | |
| } lsfitreport; | | } lsfitreport; | |
| typedef struct | | typedef struct | |
| { | | { | |
| ae_int_t optalgo; | | ae_int_t optalgo; | |
| ae_int_t m; | | ae_int_t m; | |
| | | | |
| skipping to change at line 127 | | skipping to change at line 128 | |
| ae_vector s; | | ae_vector s; | |
| ae_vector bndl; | | ae_vector bndl; | |
| ae_vector bndu; | | ae_vector bndu; | |
| ae_matrix taskx; | | ae_matrix taskx; | |
| ae_vector tasky; | | ae_vector tasky; | |
| ae_int_t npoints; | | ae_int_t npoints; | |
| ae_vector w; | | ae_vector w; | |
| ae_int_t nweights; | | ae_int_t nweights; | |
| ae_int_t wkind; | | ae_int_t wkind; | |
| ae_int_t wits; | | ae_int_t wits; | |
|
| | | double teststep; | |
| ae_bool xupdated; | | ae_bool xupdated; | |
| ae_bool needf; | | ae_bool needf; | |
| ae_bool needfg; | | ae_bool needfg; | |
| ae_bool needfgh; | | ae_bool needfgh; | |
| ae_int_t pointindex; | | ae_int_t pointindex; | |
| ae_vector x; | | ae_vector x; | |
| ae_vector c; | | ae_vector c; | |
| double f; | | double f; | |
| ae_vector g; | | ae_vector g; | |
| ae_matrix h; | | ae_matrix h; | |
|
| | | ae_vector tmp; | |
| ae_int_t repiterationscount; | | ae_int_t repiterationscount; | |
| ae_int_t repterminationtype; | | ae_int_t repterminationtype; | |
|
| | | ae_int_t repvaridx; | |
| double reprmserror; | | double reprmserror; | |
| double repavgerror; | | double repavgerror; | |
| double repavgrelerror; | | double repavgrelerror; | |
| double repmaxerror; | | double repmaxerror; | |
| double repwrmserror; | | double repwrmserror; | |
| minlmstate optstate; | | minlmstate optstate; | |
| minlmreport optrep; | | minlmreport optrep; | |
| ae_int_t prevnpt; | | ae_int_t prevnpt; | |
| ae_int_t prevalgo; | | ae_int_t prevalgo; | |
| rcommstate rstate; | | rcommstate rstate; | |
| | | | |
| skipping to change at line 209 | | skipping to change at line 213 | |
| ae_int_t arows; | | ae_int_t arows; | |
| ae_int_t acols; | | ae_int_t acols; | |
| ae_int_t annz; | | ae_int_t annz; | |
| ae_int_t iterationscount; | | ae_int_t iterationscount; | |
| ae_int_t nmv; | | ae_int_t nmv; | |
| ae_int_t terminationtype; | | ae_int_t terminationtype; | |
| } rbfreport; | | } rbfreport; | |
| typedef struct | | typedef struct | |
| { | | { | |
| ae_int_t k; | | ae_int_t k; | |
|
| ae_vector c; | | ae_int_t stype; | |
| | | ae_int_t n; | |
| | | ae_int_t m; | |
| | | ae_int_t d; | |
| | | ae_vector x; | |
| | | ae_vector y; | |
| | | ae_vector f; | |
| } spline2dinterpolant; | | } spline2dinterpolant; | |
|
| | | typedef struct | |
| | | { | |
| | | ae_int_t k; | |
| | | ae_int_t stype; | |
| | | ae_int_t n; | |
| | | ae_int_t m; | |
| | | ae_int_t l; | |
| | | ae_int_t d; | |
| | | ae_vector x; | |
| | | ae_vector y; | |
| | | ae_vector z; | |
| | | ae_vector f; | |
| | | } spline3dinterpolant; | |
| | | | |
| } | | } | |
| | | | |
| ///////////////////////////////////////////////////////////////////////// | | ///////////////////////////////////////////////////////////////////////// | |
| // | | // | |
| // THIS SECTION CONTAINS C++ INTERFACE | | // THIS SECTION CONTAINS C++ INTERFACE | |
| // | | // | |
| ///////////////////////////////////////////////////////////////////////// | | ///////////////////////////////////////////////////////////////////////// | |
| namespace alglib | | namespace alglib | |
| { | | { | |
| | | | |
| skipping to change at line 439 | | skipping to change at line 462 | |
| }; | | }; | |
| class lsfitreport : public _lsfitreport_owner | | class lsfitreport : public _lsfitreport_owner | |
| { | | { | |
| public: | | public: | |
| lsfitreport(); | | lsfitreport(); | |
| lsfitreport(const lsfitreport &rhs); | | lsfitreport(const lsfitreport &rhs); | |
| lsfitreport& operator=(const lsfitreport &rhs); | | lsfitreport& operator=(const lsfitreport &rhs); | |
| virtual ~lsfitreport(); | | virtual ~lsfitreport(); | |
| double &taskrcond; | | double &taskrcond; | |
| ae_int_t &iterationscount; | | ae_int_t &iterationscount; | |
|
| | | ae_int_t &varidx; | |
| double &rmserror; | | double &rmserror; | |
| double &avgerror; | | double &avgerror; | |
| double &avgrelerror; | | double &avgrelerror; | |
| double &maxerror; | | double &maxerror; | |
| double &wrmserror; | | double &wrmserror; | |
| | | | |
| }; | | }; | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| Nonlinear fitter. | | Nonlinear fitter. | |
| | | | |
| skipping to change at line 627 | | skipping to change at line 651 | |
| { | | { | |
| public: | | public: | |
| spline2dinterpolant(); | | spline2dinterpolant(); | |
| spline2dinterpolant(const spline2dinterpolant &rhs); | | spline2dinterpolant(const spline2dinterpolant &rhs); | |
| spline2dinterpolant& operator=(const spline2dinterpolant &rhs); | | spline2dinterpolant& operator=(const spline2dinterpolant &rhs); | |
| virtual ~spline2dinterpolant(); | | virtual ~spline2dinterpolant(); | |
| | | | |
| }; | | }; | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
|
| | | 3-dimensional spline inteprolant | |
| | | *************************************************************************/ | |
| | | class _spline3dinterpolant_owner | |
| | | { | |
| | | public: | |
| | | _spline3dinterpolant_owner(); | |
| | | _spline3dinterpolant_owner(const _spline3dinterpolant_owner &rhs); | |
| | | _spline3dinterpolant_owner& operator=(const _spline3dinterpolant_owner | |
| | | &rhs); | |
| | | virtual ~_spline3dinterpolant_owner(); | |
| | | alglib_impl::spline3dinterpolant* c_ptr(); | |
| | | alglib_impl::spline3dinterpolant* c_ptr() const; | |
| | | protected: | |
| | | alglib_impl::spline3dinterpolant *p_struct; | |
| | | }; | |
| | | class spline3dinterpolant : public _spline3dinterpolant_owner | |
| | | { | |
| | | public: | |
| | | spline3dinterpolant(); | |
| | | spline3dinterpolant(const spline3dinterpolant &rhs); | |
| | | spline3dinterpolant& operator=(const spline3dinterpolant &rhs); | |
| | | virtual ~spline3dinterpolant(); | |
| | | | |
| | | }; | |
| | | | |
| | | /************************************************************************* | |
| IDW interpolation | | IDW interpolation | |
| | | | |
| INPUT PARAMETERS: | | INPUT PARAMETERS: | |
| Z - IDW interpolant built with one of model building | | Z - IDW interpolant built with one of model building | |
| subroutines. | | subroutines. | |
| X - array[0..NX-1], interpolation point | | X - array[0..NX-1], interpolation point | |
| | | | |
| Result: | | Result: | |
| IDW interpolant Z(X) | | IDW interpolant Z(X) | |
| | | | |
| | | | |
| skipping to change at line 1806 | | skipping to change at line 1855 | |
| *************************************************************************/ | | *************************************************************************/ | |
| void spline1ddiff(const spline1dinterpolant &c, const double x, double &s,
double &ds, double &d2s); | | void spline1ddiff(const spline1dinterpolant &c, const double x, double &s,
double &ds, double &d2s); | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| This subroutine unpacks the spline into the coefficients table. | | This subroutine unpacks the spline into the coefficients table. | |
| | | | |
| INPUT PARAMETERS: | | INPUT PARAMETERS: | |
| C - spline interpolant. | | C - spline interpolant. | |
| X - point | | X - point | |
| | | | |
|
| Result: | | OUTPUT PARAMETERS: | |
| Tbl - coefficients table, unpacked format, array[0..N-2, 0..5]. | | Tbl - coefficients table, unpacked format, array[0..N-2, 0..5]. | |
| For I = 0...N-2: | | For I = 0...N-2: | |
| Tbl[I,0] = X[i] | | Tbl[I,0] = X[i] | |
| Tbl[I,1] = X[i+1] | | Tbl[I,1] = X[i+1] | |
| Tbl[I,2] = C0 | | Tbl[I,2] = C0 | |
| Tbl[I,3] = C1 | | Tbl[I,3] = C1 | |
| Tbl[I,4] = C2 | | Tbl[I,4] = C2 | |
| Tbl[I,5] = C3 | | Tbl[I,5] = C3 | |
| On [x[i], x[i+1]] spline is equals to: | | On [x[i], x[i+1]] spline is equals to: | |
| S(x) = C0 + C1*t + C2*t^2 + C3*t^3 | | S(x) = C0 + C1*t + C2*t^2 + C3*t^3 | |
| t = x-x[i] | | t = x-x[i] | |
| | | | |
|
| | | NOTE: | |
| | | You can rebuild spline with Spline1DBuildHermite() function, which | |
| | | accepts as inputs function values and derivatives at nodes, which are | |
| | | easy to calculate when you have coefficients. | |
| | | | |
| -- ALGLIB PROJECT -- | | -- ALGLIB PROJECT -- | |
| Copyright 29.06.2007 by Bochkanov Sergey | | Copyright 29.06.2007 by Bochkanov Sergey | |
| *************************************************************************/ | | *************************************************************************/ | |
| void spline1dunpack(const spline1dinterpolant &c, ae_int_t &n, real_2d_arra
y &tbl); | | void spline1dunpack(const spline1dinterpolant &c, ae_int_t &n, real_2d_arra
y &tbl); | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| This subroutine performs linear transformation of the spline argument. | | This subroutine performs linear transformation of the spline argument. | |
| | | | |
| INPUT PARAMETERS: | | INPUT PARAMETERS: | |
| C - spline interpolant. | | C - spline interpolant. | |
| | | | |
| skipping to change at line 1868 | | skipping to change at line 1922 | |
| here 'a' denotes min(x[]) | | here 'a' denotes min(x[]) | |
| Result: | | Result: | |
| integral(S(t)dt,a,x) | | integral(S(t)dt,a,x) | |
| | | | |
| -- ALGLIB PROJECT -- | | -- ALGLIB PROJECT -- | |
| Copyright 23.06.2007 by Bochkanov Sergey | | Copyright 23.06.2007 by Bochkanov Sergey | |
| *************************************************************************/ | | *************************************************************************/ | |
| double spline1dintegrate(const spline1dinterpolant &c, const double x); | | double spline1dintegrate(const spline1dinterpolant &c, const double x); | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
|
| | | This function builds monotone cubic Hermite interpolant. This interpolant | |
| | | is monotonic in [x(0),x(n-1)] and is constant outside of this interval. | |
| | | | |
| | | In case y[] form non-monotonic sequence, interpolant is piecewise | |
| | | monotonic. Say, for x=(0,1,2,3,4) and y=(0,1,2,1,0) interpolant will | |
| | | monotonically grow at [0..2] and monotonically decrease at [2..4]. | |
| | | | |
| | | INPUT PARAMETERS: | |
| | | X - spline nodes, array[0..N-1]. Subroutine automatically | |
| | | sorts points, so caller may pass unsorted array. | |
| | | Y - function values, array[0..N-1] | |
| | | N - the number of points(N>=2). | |
| | | | |
| | | OUTPUT PARAMETERS: | |
| | | C - spline interpolant. | |
| | | | |
| | | -- ALGLIB PROJECT -- | |
| | | Copyright 21.06.2012 by Bochkanov Sergey | |
| | | *************************************************************************/ | |
| | | void spline1dbuildmonotone(const real_1d_array &x, const real_1d_array &y, | |
| | | const ae_int_t n, spline1dinterpolant &c); | |
| | | void spline1dbuildmonotone(const real_1d_array &x, const real_1d_array &y, | |
| | | spline1dinterpolant &c); | |
| | | | |
| | | /************************************************************************* | |
| Fitting by polynomials in barycentric form. This function provides simple | | Fitting by polynomials in barycentric form. This function provides simple | |
| unterface for unconstrained unweighted fitting. See PolynomialFitWC() if | | unterface for unconstrained unweighted fitting. See PolynomialFitWC() if | |
| you need constrained fitting. | | you need constrained fitting. | |
| | | | |
| Task is linear, so linear least squares solver is used. Complexity of this | | Task is linear, so linear least squares solver is used. Complexity of this | |
| computational scheme is O(N*M^2), mostly dominated by least squares solver | | computational scheme is O(N*M^2), mostly dominated by least squares solver | |
| | | | |
| SEE ALSO: | | SEE ALSO: | |
| PolynomialFitWC() | | PolynomialFitWC() | |
| | | | |
| | | | |
| skipping to change at line 3076 | | skipping to change at line 3153 | |
| /************************************************************************* | | /************************************************************************* | |
| Nonlinear least squares fitting results. | | Nonlinear least squares fitting results. | |
| | | | |
| Called after return from LSFitFit(). | | Called after return from LSFitFit(). | |
| | | | |
| INPUT PARAMETERS: | | INPUT PARAMETERS: | |
| State - algorithm state | | State - algorithm state | |
| | | | |
| OUTPUT PARAMETERS: | | OUTPUT PARAMETERS: | |
| Info - completetion code: | | Info - completetion code: | |
|
| | | * -7 gradient verification failed. | |
| | | See LSFitSetGradientCheck() for more informatio | |
| | | n. | |
| * 1 relative function improvement is no more than | | * 1 relative function improvement is no more than | |
| EpsF. | | EpsF. | |
| * 2 relative step is no more than EpsX. | | * 2 relative step is no more than EpsX. | |
| * 4 gradient norm is no more than EpsG | | * 4 gradient norm is no more than EpsG | |
| * 5 MaxIts steps was taken | | * 5 MaxIts steps was taken | |
| * 7 stopping conditions are too stringent, | | * 7 stopping conditions are too stringent, | |
| further improvement is impossible | | further improvement is impossible | |
| C - array[0..K-1], solution | | C - array[0..K-1], solution | |
| Rep - optimization report. Following fields are set: | | Rep - optimization report. Following fields are set: | |
| * Rep.TerminationType completetion code: | | * Rep.TerminationType completetion code: | |
| | | | |
| skipping to change at line 3099 | | skipping to change at line 3178 | |
| * MaxError maximum error | | * MaxError maximum error | |
| NON-WEIGHTED ERRORS ARE CALCULATED | | NON-WEIGHTED ERRORS ARE CALCULATED | |
| * WRMSError weighted rms error on the (X,Y). | | * WRMSError weighted rms error on the (X,Y). | |
| | | | |
| -- ALGLIB -- | | -- ALGLIB -- | |
| Copyright 17.08.2009 by Bochkanov Sergey | | Copyright 17.08.2009 by Bochkanov Sergey | |
| *************************************************************************/ | | *************************************************************************/ | |
| void lsfitresults(const lsfitstate &state, ae_int_t &info, real_1d_array &c
, lsfitreport &rep); | | void lsfitresults(const lsfitstate &state, ae_int_t &info, real_1d_array &c
, lsfitreport &rep); | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
|
| | | This subroutine turns on verification of the user-supplied analytic | |
| | | gradient: | |
| | | * user calls this subroutine before fitting begins | |
| | | * LSFitFit() is called | |
| | | * prior to actual fitting, for each point in data set X_i and each | |
| | | component of parameters being fited C_j algorithm performs following | |
| | | steps: | |
| | | * two trial steps are made to C_j-TestStep*S[j] and C_j+TestStep*S[j], | |
| | | where C_j is j-th parameter and S[j] is a scale of j-th parameter | |
| | | * if needed, steps are bounded with respect to constraints on C[] | |
| | | * F(X_i|C) is evaluated at these trial points | |
| | | * we perform one more evaluation in the middle point of the interval | |
| | | * we build cubic model using function values and derivatives at trial | |
| | | points and we compare its prediction with actual value in the middle | |
| | | point | |
| | | * in case difference between prediction and actual value is higher than | |
| | | some predetermined threshold, algorithm stops with completion code -7; | |
| | | Rep.VarIdx is set to index of the parameter with incorrect derivative. | |
| | | * after verification is over, algorithm proceeds to the actual optimization | |
| | | . | |
| | | | |
| | | NOTE 1: verification needs N*K (points count * parameters count) gradient | |
| | | evaluations. It is very costly and you should use it only for low | |
| | | dimensional problems, when you want to be sure that you've | |
| | | correctly calculated analytic derivatives. You should not use it | |
| | | in the production code (unless you want to check derivatives | |
| | | provided by some third party). | |
| | | | |
| | | NOTE 2: you should carefully choose TestStep. Value which is too large | |
| | | (so large that function behaviour is significantly non-cubic) will | |
| | | lead to false alarms. You may use different step for different | |
| | | parameters by means of setting scale with LSFitSetScale(). | |
| | | | |
| | | NOTE 3: this function may lead to false positives. In case it reports that | |
| | | I-th derivative was calculated incorrectly, you may decrease test | |
| | | step and try one more time - maybe your function changes too | |
| | | sharply and your step is too large for such rapidly chanding | |
| | | function. | |
| | | | |
| | | NOTE 4: this function works only for optimizers created with LSFitCreateWFG | |
| | | () | |
| | | or LSFitCreateFG() constructors. | |
| | | | |
| | | INPUT PARAMETERS: | |
| | | State - structure used to store algorithm state | |
| | | TestStep - verification step: | |
| | | * TestStep=0 turns verification off | |
| | | * TestStep>0 activates verification | |
| | | | |
| | | -- ALGLIB -- | |
| | | Copyright 15.06.2012 by Bochkanov Sergey | |
| | | *************************************************************************/ | |
| | | void lsfitsetgradientcheck(const lsfitstate &state, const double teststep); | |
| | | | |
| | | /************************************************************************* | |
| This function builds non-periodic 2-dimensional parametric spline which | | This function builds non-periodic 2-dimensional parametric spline which | |
| starts at (X[0],Y[0]) and ends at (X[N-1],Y[N-1]). | | starts at (X[0],Y[0]) and ends at (X[N-1],Y[N-1]). | |
| | | | |
| INPUT PARAMETERS: | | INPUT PARAMETERS: | |
| XY - points, array[0..N-1,0..1]. | | XY - points, array[0..N-1,0..1]. | |
| XY[I,0:1] corresponds to the Ith point. | | XY[I,0:1] corresponds to the Ith point. | |
| Order of points is important! | | Order of points is important! | |
| N - points count, N>=5 for Akima splines, N>=2 for other types of | | N - points count, N>=5 for Akima splines, N>=2 for other types of | |
| splines. | | splines. | |
| ST - spline type: | | ST - spline type: | |
| | | | |
| skipping to change at line 3959 | | skipping to change at line 4091 | |
| dimension of the function being modelled. First NX | | dimension of the function being modelled. First NX | |
| elements are linear coefficients, V[NX] is equal to the | | elements are linear coefficients, V[NX] is equal to the | |
| constant part. | | constant part. | |
| | | | |
| -- ALGLIB -- | | -- ALGLIB -- | |
| Copyright 13.12.2011 by Bochkanov Sergey | | Copyright 13.12.2011 by Bochkanov Sergey | |
| *************************************************************************/ | | *************************************************************************/ | |
| void rbfunpack(const rbfmodel &s, ae_int_t &nx, ae_int_t &ny, real_2d_array
&xwr, ae_int_t &nc, real_2d_array &v); | | void rbfunpack(const rbfmodel &s, ae_int_t &nx, ae_int_t &ny, real_2d_array
&xwr, ae_int_t &nc, real_2d_array &v); | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
|
| This subroutine builds bilinear spline coefficients table. | | | |
| | | | |
| Input parameters: | | | |
| X - spline abscissas, array[0..N-1] | | | |
| Y - spline ordinates, array[0..M-1] | | | |
| F - function values, array[0..M-1,0..N-1] | | | |
| M,N - grid size, M>=2, N>=2 | | | |
| | | | |
| Output parameters: | | | |
| C - spline interpolant | | | |
| | | | |
| -- ALGLIB PROJECT -- | | | |
| Copyright 05.07.2007 by Bochkanov Sergey | | | |
| *************************************************************************/ | | | |
| void spline2dbuildbilinear(const real_1d_array &x, const real_1d_array &y, | | | |
| const real_2d_array &f, const ae_int_t m, const ae_int_t n, spline2dinterpo | | | |
| lant &c); | | | |
| | | | |
| /************************************************************************* | | | |
| This subroutine builds bicubic spline coefficients table. | | | |
| | | | |
| Input parameters: | | | |
| X - spline abscissas, array[0..N-1] | | | |
| Y - spline ordinates, array[0..M-1] | | | |
| F - function values, array[0..M-1,0..N-1] | | | |
| M,N - grid size, M>=2, N>=2 | | | |
| | | | |
| Output parameters: | | | |
| C - spline interpolant | | | |
| | | | |
| -- ALGLIB PROJECT -- | | | |
| Copyright 05.07.2007 by Bochkanov Sergey | | | |
| *************************************************************************/ | | | |
| void spline2dbuildbicubic(const real_1d_array &x, const real_1d_array &y, c | | | |
| onst real_2d_array &f, const ae_int_t m, const ae_int_t n, spline2dinterpol | | | |
| ant &c); | | | |
| | | | |
| /************************************************************************* | | | |
| This subroutine calculates the value of the bilinear or bicubic spline at | | This subroutine calculates the value of the bilinear or bicubic spline at | |
| the given point X. | | the given point X. | |
| | | | |
| Input parameters: | | Input parameters: | |
| C - coefficients table. | | C - coefficients table. | |
| Built by BuildBilinearSpline or BuildBicubicSpline. | | Built by BuildBilinearSpline or BuildBicubicSpline. | |
| X, Y- point | | X, Y- point | |
| | | | |
| Result: | | Result: | |
| S(x,y) | | S(x,y) | |
| | | | |
| skipping to change at line 4029 | | skipping to change at line 4127 | |
| FX - dS(x,y)/dX | | FX - dS(x,y)/dX | |
| FY - dS(x,y)/dY | | FY - dS(x,y)/dY | |
| FXY - d2S(x,y)/dXdY | | FXY - d2S(x,y)/dXdY | |
| | | | |
| -- ALGLIB PROJECT -- | | -- ALGLIB PROJECT -- | |
| Copyright 05.07.2007 by Bochkanov Sergey | | Copyright 05.07.2007 by Bochkanov Sergey | |
| *************************************************************************/ | | *************************************************************************/ | |
| void spline2ddiff(const spline2dinterpolant &c, const double x, const doubl
e y, double &f, double &fx, double &fy, double &fxy); | | void spline2ddiff(const spline2dinterpolant &c, const double x, const doubl
e y, double &f, double &fx, double &fy, double &fxy); | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
|
| This subroutine unpacks two-dimensional spline into the coefficients table | | | |
| | | | |
| Input parameters: | | | |
| C - spline interpolant. | | | |
| | | | |
| Result: | | | |
| M, N- grid size (x-axis and y-axis) | | | |
| Tbl - coefficients table, unpacked format, | | | |
| [0..(N-1)*(M-1)-1, 0..19]. | | | |
| For I = 0...M-2, J=0..N-2: | | | |
| K = I*(N-1)+J | | | |
| Tbl[K,0] = X[j] | | | |
| Tbl[K,1] = X[j+1] | | | |
| Tbl[K,2] = Y[i] | | | |
| Tbl[K,3] = Y[i+1] | | | |
| Tbl[K,4] = C00 | | | |
| Tbl[K,5] = C01 | | | |
| Tbl[K,6] = C02 | | | |
| Tbl[K,7] = C03 | | | |
| Tbl[K,8] = C10 | | | |
| Tbl[K,9] = C11 | | | |
| ... | | | |
| Tbl[K,19] = C33 | | | |
| On each grid square spline is equals to: | | | |
| S(x) = SUM(c[i,j]*(x^i)*(y^j), i=0..3, j=0..3) | | | |
| t = x-x[j] | | | |
| u = y-y[i] | | | |
| | | | |
| -- ALGLIB PROJECT -- | | | |
| Copyright 29.06.2007 by Bochkanov Sergey | | | |
| *************************************************************************/ | | | |
| void spline2dunpack(const spline2dinterpolant &c, ae_int_t &m, ae_int_t &n, | | | |
| real_2d_array &tbl); | | | |
| | | | |
| /************************************************************************* | | | |
| This subroutine performs linear transformation of the spline argument. | | This subroutine performs linear transformation of the spline argument. | |
| | | | |
| Input parameters: | | Input parameters: | |
| C - spline interpolant | | C - spline interpolant | |
| AX, BX - transformation coefficients: x = A*t + B | | AX, BX - transformation coefficients: x = A*t + B | |
| AY, BY - transformation coefficients: y = A*u + B | | AY, BY - transformation coefficients: y = A*u + B | |
| Result: | | Result: | |
| C - transformed spline | | C - transformed spline | |
| | | | |
| -- ALGLIB PROJECT -- | | -- ALGLIB PROJECT -- | |
| | | | |
| skipping to change at line 4093 | | skipping to change at line 4157 | |
| | | | |
| Output parameters: | | Output parameters: | |
| C - transformed spline | | C - transformed spline | |
| | | | |
| -- ALGLIB PROJECT -- | | -- ALGLIB PROJECT -- | |
| Copyright 30.06.2007 by Bochkanov Sergey | | Copyright 30.06.2007 by Bochkanov Sergey | |
| *************************************************************************/ | | *************************************************************************/ | |
| void spline2dlintransf(const spline2dinterpolant &c, const double a, const
double b); | | void spline2dlintransf(const spline2dinterpolant &c, const double a, const
double b); | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
|
| | | This subroutine makes the copy of the spline model. | |
| | | | |
| | | Input parameters: | |
| | | C - spline interpolant | |
| | | | |
| | | Output parameters: | |
| | | CC - spline copy | |
| | | | |
| | | -- ALGLIB PROJECT -- | |
| | | Copyright 29.06.2007 by Bochkanov Sergey | |
| | | *************************************************************************/ | |
| | | void spline2dcopy(const spline2dinterpolant &c, spline2dinterpolant &cc); | |
| | | | |
| | | /************************************************************************* | |
| Bicubic spline resampling | | Bicubic spline resampling | |
| | | | |
| Input parameters: | | Input parameters: | |
| A - function values at the old grid, | | A - function values at the old grid, | |
| array[0..OldHeight-1, 0..OldWidth-1] | | array[0..OldHeight-1, 0..OldWidth-1] | |
| OldHeight - old grid height, OldHeight>1 | | OldHeight - old grid height, OldHeight>1 | |
| OldWidth - old grid width, OldWidth>1 | | OldWidth - old grid width, OldWidth>1 | |
| NewHeight - new grid height, NewHeight>1 | | NewHeight - new grid height, NewHeight>1 | |
| NewWidth - new grid width, NewWidth>1 | | NewWidth - new grid width, NewWidth>1 | |
| | | | |
| | | | |
| skipping to change at line 4133 | | skipping to change at line 4211 | |
| | | | |
| Output parameters: | | Output parameters: | |
| B - function values at the new grid, | | B - function values at the new grid, | |
| array[0..NewHeight-1, 0..NewWidth-1] | | array[0..NewHeight-1, 0..NewWidth-1] | |
| | | | |
| -- ALGLIB routine -- | | -- ALGLIB routine -- | |
| 09.07.2007 | | 09.07.2007 | |
| Copyright by Bochkanov Sergey | | Copyright by Bochkanov Sergey | |
| *************************************************************************/ | | *************************************************************************/ | |
| void spline2dresamplebilinear(const real_2d_array &a, const ae_int_t oldhei
ght, const ae_int_t oldwidth, real_2d_array &b, const ae_int_t newheight, c
onst ae_int_t newwidth); | | void spline2dresamplebilinear(const real_2d_array &a, const ae_int_t oldhei
ght, const ae_int_t oldwidth, real_2d_array &b, const ae_int_t newheight, c
onst ae_int_t newwidth); | |
|
| | | | |
| | | /************************************************************************* | |
| | | This subroutine builds bilinear vector-valued spline. | |
| | | | |
| | | Input parameters: | |
| | | X - spline abscissas, array[0..N-1] | |
| | | Y - spline ordinates, array[0..M-1] | |
| | | F - function values, array[0..M*N*D-1]: | |
| | | * first D elements store D values at (X[0],Y[0]) | |
| | | * next D elements store D values at (X[1],Y[0]) | |
| | | * general form - D function values at (X[i],Y[j]) are stored | |
| | | at F[D*(J*N+I)...D*(J*N+I)+D-1]. | |
| | | M,N - grid size, M>=2, N>=2 | |
| | | D - vector dimension, D>=1 | |
| | | | |
| | | Output parameters: | |
| | | C - spline interpolant | |
| | | | |
| | | -- ALGLIB PROJECT -- | |
| | | Copyright 16.04.2012 by Bochkanov Sergey | |
| | | *************************************************************************/ | |
| | | void spline2dbuildbilinearv(const real_1d_array &x, const ae_int_t n, const | |
| | | real_1d_array &y, const ae_int_t m, const real_1d_array &f, const ae_int_t | |
| | | d, spline2dinterpolant &c); | |
| | | | |
| | | /************************************************************************* | |
| | | This subroutine builds bicubic vector-valued spline. | |
| | | | |
| | | Input parameters: | |
| | | X - spline abscissas, array[0..N-1] | |
| | | Y - spline ordinates, array[0..M-1] | |
| | | F - function values, array[0..M*N*D-1]: | |
| | | * first D elements store D values at (X[0],Y[0]) | |
| | | * next D elements store D values at (X[1],Y[0]) | |
| | | * general form - D function values at (X[i],Y[j]) are stored | |
| | | at F[D*(J*N+I)...D*(J*N+I)+D-1]. | |
| | | M,N - grid size, M>=2, N>=2 | |
| | | D - vector dimension, D>=1 | |
| | | | |
| | | Output parameters: | |
| | | C - spline interpolant | |
| | | | |
| | | -- ALGLIB PROJECT -- | |
| | | Copyright 16.04.2012 by Bochkanov Sergey | |
| | | *************************************************************************/ | |
| | | void spline2dbuildbicubicv(const real_1d_array &x, const ae_int_t n, const | |
| | | real_1d_array &y, const ae_int_t m, const real_1d_array &f, const ae_int_t | |
| | | d, spline2dinterpolant &c); | |
| | | | |
| | | /************************************************************************* | |
| | | This subroutine calculates bilinear or bicubic vector-valued spline at the | |
| | | given point (X,Y). | |
| | | | |
| | | INPUT PARAMETERS: | |
| | | C - spline interpolant. | |
| | | X, Y- point | |
| | | F - output buffer, possibly preallocated array. In case array size | |
| | | is large enough to store result, it is not reallocated. Array | |
| | | which is too short will be reallocated | |
| | | | |
| | | OUTPUT PARAMETERS: | |
| | | F - array[D] (or larger) which stores function values | |
| | | | |
| | | -- ALGLIB PROJECT -- | |
| | | Copyright 16.04.2012 by Bochkanov Sergey | |
| | | *************************************************************************/ | |
| | | void spline2dcalcvbuf(const spline2dinterpolant &c, const double x, const d | |
| | | ouble y, real_1d_array &f); | |
| | | | |
| | | /************************************************************************* | |
| | | This subroutine calculates bilinear or bicubic vector-valued spline at the | |
| | | given point (X,Y). | |
| | | | |
| | | INPUT PARAMETERS: | |
| | | C - spline interpolant. | |
| | | X, Y- point | |
| | | | |
| | | OUTPUT PARAMETERS: | |
| | | F - array[D] which stores function values. F is out-parameter and | |
| | | it is reallocated after call to this function. In case you | |
| | | want to reuse previously allocated F, you may use | |
| | | Spline2DCalcVBuf(), which reallocates F only when it is too | |
| | | small. | |
| | | | |
| | | -- ALGLIB PROJECT -- | |
| | | Copyright 16.04.2012 by Bochkanov Sergey | |
| | | *************************************************************************/ | |
| | | void spline2dcalcv(const spline2dinterpolant &c, const double x, const doub | |
| | | le y, real_1d_array &f); | |
| | | | |
| | | /************************************************************************* | |
| | | This subroutine unpacks two-dimensional spline into the coefficients table | |
| | | | |
| | | Input parameters: | |
| | | C - spline interpolant. | |
| | | | |
| | | Result: | |
| | | M, N- grid size (x-axis and y-axis) | |
| | | D - number of components | |
| | | Tbl - coefficients table, unpacked format, | |
| | | D - components: [0..(N-1)*(M-1)*D-1, 0..19]. | |
| | | For T=0..D-1 (component index), I = 0...N-2 (x index), | |
| | | J=0..M-2 (y index): | |
| | | K := T + I*D + J*D*(N-1) | |
| | | | |
| | | K-th row stores decomposition for T-th component of the | |
| | | vector-valued function | |
| | | | |
| | | Tbl[K,0] = X[i] | |
| | | Tbl[K,1] = X[i+1] | |
| | | Tbl[K,2] = Y[j] | |
| | | Tbl[K,3] = Y[j+1] | |
| | | Tbl[K,4] = C00 | |
| | | Tbl[K,5] = C01 | |
| | | Tbl[K,6] = C02 | |
| | | Tbl[K,7] = C03 | |
| | | Tbl[K,8] = C10 | |
| | | Tbl[K,9] = C11 | |
| | | ... | |
| | | Tbl[K,19] = C33 | |
| | | On each grid square spline is equals to: | |
| | | S(x) = SUM(c[i,j]*(t^i)*(u^j), i=0..3, j=0..3) | |
| | | t = x-x[j] | |
| | | u = y-y[i] | |
| | | | |
| | | -- ALGLIB PROJECT -- | |
| | | Copyright 16.04.2012 by Bochkanov Sergey | |
| | | *************************************************************************/ | |
| | | void spline2dunpackv(const spline2dinterpolant &c, ae_int_t &m, ae_int_t &n | |
| | | , ae_int_t &d, real_2d_array &tbl); | |
| | | | |
| | | /************************************************************************* | |
| | | This subroutine was deprecated in ALGLIB 3.6.0 | |
| | | | |
| | | We recommend you to switch to Spline2DBuildBilinearV(), which is more | |
| | | flexible and accepts its arguments in more convenient order. | |
| | | | |
| | | -- ALGLIB PROJECT -- | |
| | | Copyright 05.07.2007 by Bochkanov Sergey | |
| | | *************************************************************************/ | |
| | | void spline2dbuildbilinear(const real_1d_array &x, const real_1d_array &y, | |
| | | const real_2d_array &f, const ae_int_t m, const ae_int_t n, spline2dinterpo | |
| | | lant &c); | |
| | | | |
| | | /************************************************************************* | |
| | | This subroutine was deprecated in ALGLIB 3.6.0 | |
| | | | |
| | | We recommend you to switch to Spline2DBuildBicubicV(), which is more | |
| | | flexible and accepts its arguments in more convenient order. | |
| | | | |
| | | -- ALGLIB PROJECT -- | |
| | | Copyright 05.07.2007 by Bochkanov Sergey | |
| | | *************************************************************************/ | |
| | | void spline2dbuildbicubic(const real_1d_array &x, const real_1d_array &y, c | |
| | | onst real_2d_array &f, const ae_int_t m, const ae_int_t n, spline2dinterpol | |
| | | ant &c); | |
| | | | |
| | | /************************************************************************* | |
| | | This subroutine was deprecated in ALGLIB 3.6.0 | |
| | | | |
| | | We recommend you to switch to Spline2DUnpackV(), which is more flexible | |
| | | and accepts its arguments in more convenient order. | |
| | | | |
| | | -- ALGLIB PROJECT -- | |
| | | Copyright 29.06.2007 by Bochkanov Sergey | |
| | | *************************************************************************/ | |
| | | void spline2dunpack(const spline2dinterpolant &c, ae_int_t &m, ae_int_t &n, | |
| | | real_2d_array &tbl); | |
| | | | |
| | | /************************************************************************* | |
| | | This subroutine calculates the value of the trilinear or tricubic spline at | |
| | | the given point (X,Y,Z). | |
| | | | |
| | | INPUT PARAMETERS: | |
| | | C - coefficients table. | |
| | | Built by BuildBilinearSpline or BuildBicubicSpline. | |
| | | X, Y, | |
| | | Z - point | |
| | | | |
| | | Result: | |
| | | S(x,y,z) | |
| | | | |
| | | -- ALGLIB PROJECT -- | |
| | | Copyright 26.04.2012 by Bochkanov Sergey | |
| | | *************************************************************************/ | |
| | | double spline3dcalc(const spline3dinterpolant &c, const double x, const dou | |
| | | ble y, const double z); | |
| | | | |
| | | /************************************************************************* | |
| | | This subroutine performs linear transformation of the spline argument. | |
| | | | |
| | | INPUT PARAMETERS: | |
| | | C - spline interpolant | |
| | | AX, BX - transformation coefficients: x = A*u + B | |
| | | AY, BY - transformation coefficients: y = A*v + B | |
| | | AZ, BZ - transformation coefficients: z = A*w + B | |
| | | | |
| | | OUTPUT PARAMETERS: | |
| | | C - transformed spline | |
| | | | |
| | | -- ALGLIB PROJECT -- | |
| | | Copyright 26.04.2012 by Bochkanov Sergey | |
| | | *************************************************************************/ | |
| | | void spline3dlintransxyz(const spline3dinterpolant &c, const double ax, con | |
| | | st double bx, const double ay, const double by, const double az, const doub | |
| | | le bz); | |
| | | | |
| | | /************************************************************************* | |
| | | This subroutine performs linear transformation of the spline. | |
| | | | |
| | | INPUT PARAMETERS: | |
| | | C - spline interpolant. | |
| | | A, B- transformation coefficients: S2(x,y) = A*S(x,y,z) + B | |
| | | | |
| | | OUTPUT PARAMETERS: | |
| | | C - transformed spline | |
| | | | |
| | | -- ALGLIB PROJECT -- | |
| | | Copyright 26.04.2012 by Bochkanov Sergey | |
| | | *************************************************************************/ | |
| | | void spline3dlintransf(const spline3dinterpolant &c, const double a, const | |
| | | double b); | |
| | | | |
| | | /************************************************************************* | |
| | | Trilinear spline resampling | |
| | | | |
| | | INPUT PARAMETERS: | |
| | | A - array[0..OldXCount*OldYCount*OldZCount-1], function | |
| | | values at the old grid, : | |
| | | A[0] x=0,y=0,z=0 | |
| | | A[1] x=1,y=0,z=0 | |
| | | A[..] ... | |
| | | A[..] x=oldxcount-1,y=0,z=0 | |
| | | A[..] x=0,y=1,z=0 | |
| | | A[..] ... | |
| | | ... | |
| | | OldZCount - old Z-count, OldZCount>1 | |
| | | OldYCount - old Y-count, OldYCount>1 | |
| | | OldXCount - old X-count, OldXCount>1 | |
| | | NewZCount - new Z-count, NewZCount>1 | |
| | | NewYCount - new Y-count, NewYCount>1 | |
| | | NewXCount - new X-count, NewXCount>1 | |
| | | | |
| | | OUTPUT PARAMETERS: | |
| | | B - array[0..NewXCount*NewYCount*NewZCount-1], function | |
| | | values at the new grid: | |
| | | B[0] x=0,y=0,z=0 | |
| | | B[1] x=1,y=0,z=0 | |
| | | B[..] ... | |
| | | B[..] x=newxcount-1,y=0,z=0 | |
| | | B[..] x=0,y=1,z=0 | |
| | | B[..] ... | |
| | | ... | |
| | | | |
| | | -- ALGLIB routine -- | |
| | | 26.04.2012 | |
| | | Copyright by Bochkanov Sergey | |
| | | *************************************************************************/ | |
| | | void spline3dresampletrilinear(const real_1d_array &a, const ae_int_t oldzc | |
| | | ount, const ae_int_t oldycount, const ae_int_t oldxcount, const ae_int_t ne | |
| | | wzcount, const ae_int_t newycount, const ae_int_t newxcount, real_1d_array | |
| | | &b); | |
| | | | |
| | | /************************************************************************* | |
| | | This subroutine builds trilinear vector-valued spline. | |
| | | | |
| | | INPUT PARAMETERS: | |
| | | X - spline abscissas, array[0..N-1] | |
| | | Y - spline ordinates, array[0..M-1] | |
| | | Z - spline applicates, array[0..L-1] | |
| | | F - function values, array[0..M*N*L*D-1]: | |
| | | * first D elements store D values at (X[0],Y[0],Z[0]) | |
| | | * next D elements store D values at (X[1],Y[0],Z[0]) | |
| | | * next D elements store D values at (X[2],Y[0],Z[0]) | |
| | | * ... | |
| | | * next D elements store D values at (X[0],Y[1],Z[0]) | |
| | | * next D elements store D values at (X[1],Y[1],Z[0]) | |
| | | * next D elements store D values at (X[2],Y[1],Z[0]) | |
| | | * ... | |
| | | * next D elements store D values at (X[0],Y[0],Z[1]) | |
| | | * next D elements store D values at (X[1],Y[0],Z[1]) | |
| | | * next D elements store D values at (X[2],Y[0],Z[1]) | |
| | | * ... | |
| | | * general form - D function values at (X[i],Y[j]) are stored | |
| | | at F[D*(N*(M*K+J)+I)...D*(N*(M*K+J)+I)+D-1]. | |
| | | M,N, | |
| | | L - grid size, M>=2, N>=2, L>=2 | |
| | | D - vector dimension, D>=1 | |
| | | | |
| | | OUTPUT PARAMETERS: | |
| | | C - spline interpolant | |
| | | | |
| | | -- ALGLIB PROJECT -- | |
| | | Copyright 26.04.2012 by Bochkanov Sergey | |
| | | *************************************************************************/ | |
| | | void spline3dbuildtrilinearv(const real_1d_array &x, const ae_int_t n, cons | |
| | | t real_1d_array &y, const ae_int_t m, const real_1d_array &z, const ae_int_ | |
| | | t l, const real_1d_array &f, const ae_int_t d, spline3dinterpolant &c); | |
| | | | |
| | | /************************************************************************* | |
| | | This subroutine calculates bilinear or bicubic vector-valued spline at the | |
| | | given point (X,Y,Z). | |
| | | | |
| | | INPUT PARAMETERS: | |
| | | C - spline interpolant. | |
| | | X, Y, | |
| | | Z - point | |
| | | F - output buffer, possibly preallocated array. In case array size | |
| | | is large enough to store result, it is not reallocated. Array | |
| | | which is too short will be reallocated | |
| | | | |
| | | OUTPUT PARAMETERS: | |
| | | F - array[D] (or larger) which stores function values | |
| | | | |
| | | -- ALGLIB PROJECT -- | |
| | | Copyright 26.04.2012 by Bochkanov Sergey | |
| | | *************************************************************************/ | |
| | | void spline3dcalcvbuf(const spline3dinterpolant &c, const double x, const d | |
| | | ouble y, const double z, real_1d_array &f); | |
| | | | |
| | | /************************************************************************* | |
| | | This subroutine calculates trilinear or tricubic vector-valued spline at th | |
| | | e | |
| | | given point (X,Y,Z). | |
| | | | |
| | | INPUT PARAMETERS: | |
| | | C - spline interpolant. | |
| | | X, Y, | |
| | | Z - point | |
| | | | |
| | | OUTPUT PARAMETERS: | |
| | | F - array[D] which stores function values. F is out-parameter and | |
| | | it is reallocated after call to this function. In case you | |
| | | want to reuse previously allocated F, you may use | |
| | | Spline2DCalcVBuf(), which reallocates F only when it is too | |
| | | small. | |
| | | | |
| | | -- ALGLIB PROJECT -- | |
| | | Copyright 26.04.2012 by Bochkanov Sergey | |
| | | *************************************************************************/ | |
| | | void spline3dcalcv(const spline3dinterpolant &c, const double x, const doub | |
| | | le y, const double z, real_1d_array &f); | |
| | | | |
| | | /************************************************************************* | |
| | | This subroutine unpacks tri-dimensional spline into the coefficients table | |
| | | | |
| | | INPUT PARAMETERS: | |
| | | C - spline interpolant. | |
| | | | |
| | | Result: | |
| | | N - grid size (X) | |
| | | M - grid size (Y) | |
| | | L - grid size (Z) | |
| | | D - number of components | |
| | | SType- spline type. Currently, only one spline type is supported: | |
| | | trilinear spline, as indicated by SType=1. | |
| | | Tbl - spline coefficients: [0..(N-1)*(M-1)*(L-1)*D-1, 0..13]. | |
| | | For T=0..D-1 (component index), I = 0...N-2 (x index), | |
| | | J=0..M-2 (y index), K=0..L-2 (z index): | |
| | | Q := T + I*D + J*D*(N-1) + K*D*(N-1)*(M-1), | |
| | | | |
| | | Q-th row stores decomposition for T-th component of the | |
| | | vector-valued function | |
| | | | |
| | | Tbl[Q,0] = X[i] | |
| | | Tbl[Q,1] = X[i+1] | |
| | | Tbl[Q,2] = Y[j] | |
| | | Tbl[Q,3] = Y[j+1] | |
| | | Tbl[Q,4] = Z[k] | |
| | | Tbl[Q,5] = Z[k+1] | |
| | | | |
| | | Tbl[Q,6] = C000 | |
| | | Tbl[Q,7] = C100 | |
| | | Tbl[Q,8] = C010 | |
| | | Tbl[Q,9] = C110 | |
| | | Tbl[Q,10]= C001 | |
| | | Tbl[Q,11]= C101 | |
| | | Tbl[Q,12]= C011 | |
| | | Tbl[Q,13]= C111 | |
| | | On each grid square spline is equals to: | |
| | | S(x) = SUM(c[i,j,k]*(x^i)*(y^j)*(z^k), i=0..1, j=0..1, k=0. | |
| | | .1) | |
| | | t = x-x[j] | |
| | | u = y-y[i] | |
| | | v = z-z[k] | |
| | | | |
| | | NOTE: format of Tbl is given for SType=1. Future versions of | |
| | | ALGLIB can use different formats for different values of | |
| | | SType. | |
| | | | |
| | | -- ALGLIB PROJECT -- | |
| | | Copyright 26.04.2012 by Bochkanov Sergey | |
| | | *************************************************************************/ | |
| | | void spline3dunpackv(const spline3dinterpolant &c, ae_int_t &n, ae_int_t &m | |
| | | , ae_int_t &l, ae_int_t &d, ae_int_t &stype, real_2d_array &tbl); | |
| } | | } | |
| | | | |
| ///////////////////////////////////////////////////////////////////////// | | ///////////////////////////////////////////////////////////////////////// | |
| // | | // | |
| // THIS SECTION CONTAINS COMPUTATIONAL CORE DECLARATIONS (FUNCTIONS) | | // THIS SECTION CONTAINS COMPUTATIONAL CORE DECLARATIONS (FUNCTIONS) | |
| // | | // | |
| ///////////////////////////////////////////////////////////////////////// | | ///////////////////////////////////////////////////////////////////////// | |
| namespace alglib_impl | | namespace alglib_impl | |
| { | | { | |
| double idwcalc(idwinterpolant* z, | | double idwcalc(idwinterpolant* z, | |
| | | | |
| skipping to change at line 4449 | | skipping to change at line 4896 | |
| /* Real */ ae_vector* tempdata, | | /* Real */ ae_vector* tempdata, | |
| ae_state *_state); | | ae_state *_state); | |
| ae_int_t bisectmethod(double pa, | | ae_int_t bisectmethod(double pa, | |
| double ma, | | double ma, | |
| double pb, | | double pb, | |
| double mb, | | double mb, | |
| double a, | | double a, | |
| double b, | | double b, | |
| double* x, | | double* x, | |
| ae_state *_state); | | ae_state *_state); | |
|
| | | void spline1dbuildmonotone(/* Real */ ae_vector* x, | |
| | | /* Real */ ae_vector* y, | |
| | | ae_int_t n, | |
| | | spline1dinterpolant* c, | |
| | | ae_state *_state); | |
| ae_bool _spline1dinterpolant_init(spline1dinterpolant* p, ae_state *_state,
ae_bool make_automatic); | | ae_bool _spline1dinterpolant_init(spline1dinterpolant* p, ae_state *_state,
ae_bool make_automatic); | |
| ae_bool _spline1dinterpolant_init_copy(spline1dinterpolant* dst, spline1din
terpolant* src, ae_state *_state, ae_bool make_automatic); | | ae_bool _spline1dinterpolant_init_copy(spline1dinterpolant* dst, spline1din
terpolant* src, ae_state *_state, ae_bool make_automatic); | |
| void _spline1dinterpolant_clear(spline1dinterpolant* p); | | void _spline1dinterpolant_clear(spline1dinterpolant* p); | |
| void polynomialfit(/* Real */ ae_vector* x, | | void polynomialfit(/* Real */ ae_vector* x, | |
| /* Real */ ae_vector* y, | | /* Real */ ae_vector* y, | |
| ae_int_t n, | | ae_int_t n, | |
| ae_int_t m, | | ae_int_t m, | |
| ae_int_t* info, | | ae_int_t* info, | |
| barycentricinterpolant* p, | | barycentricinterpolant* p, | |
| polynomialfitreport* rep, | | polynomialfitreport* rep, | |
| | | | |
| skipping to change at line 4668 | | skipping to change at line 5120 | |
| void lsfitsetbc(lsfitstate* state, | | void lsfitsetbc(lsfitstate* state, | |
| /* Real */ ae_vector* bndl, | | /* Real */ ae_vector* bndl, | |
| /* Real */ ae_vector* bndu, | | /* Real */ ae_vector* bndu, | |
| ae_state *_state); | | ae_state *_state); | |
| ae_bool lsfititeration(lsfitstate* state, ae_state *_state); | | ae_bool lsfititeration(lsfitstate* state, ae_state *_state); | |
| void lsfitresults(lsfitstate* state, | | void lsfitresults(lsfitstate* state, | |
| ae_int_t* info, | | ae_int_t* info, | |
| /* Real */ ae_vector* c, | | /* Real */ ae_vector* c, | |
| lsfitreport* rep, | | lsfitreport* rep, | |
| ae_state *_state); | | ae_state *_state); | |
|
| | | void lsfitsetgradientcheck(lsfitstate* state, | |
| | | double teststep, | |
| | | ae_state *_state); | |
| void lsfitscalexy(/* Real */ ae_vector* x, | | void lsfitscalexy(/* Real */ ae_vector* x, | |
| /* Real */ ae_vector* y, | | /* Real */ ae_vector* y, | |
| /* Real */ ae_vector* w, | | /* Real */ ae_vector* w, | |
| ae_int_t n, | | ae_int_t n, | |
| /* Real */ ae_vector* xc, | | /* Real */ ae_vector* xc, | |
| /* Real */ ae_vector* yc, | | /* Real */ ae_vector* yc, | |
| /* Integer */ ae_vector* dc, | | /* Integer */ ae_vector* dc, | |
| ae_int_t k, | | ae_int_t k, | |
| double* xa, | | double* xa, | |
| double* xb, | | double* xb, | |
| | | | |
| skipping to change at line 4860 | | skipping to change at line 5315 | |
| ae_state *_state); | | ae_state *_state); | |
| void rbfalloc(ae_serializer* s, rbfmodel* model, ae_state *_state); | | void rbfalloc(ae_serializer* s, rbfmodel* model, ae_state *_state); | |
| void rbfserialize(ae_serializer* s, rbfmodel* model, ae_state *_state); | | void rbfserialize(ae_serializer* s, rbfmodel* model, ae_state *_state); | |
| void rbfunserialize(ae_serializer* s, rbfmodel* model, ae_state *_state); | | void rbfunserialize(ae_serializer* s, rbfmodel* model, ae_state *_state); | |
| ae_bool _rbfmodel_init(rbfmodel* p, ae_state *_state, ae_bool make_automati
c); | | ae_bool _rbfmodel_init(rbfmodel* p, ae_state *_state, ae_bool make_automati
c); | |
| ae_bool _rbfmodel_init_copy(rbfmodel* dst, rbfmodel* src, ae_state *_state,
ae_bool make_automatic); | | ae_bool _rbfmodel_init_copy(rbfmodel* dst, rbfmodel* src, ae_state *_state,
ae_bool make_automatic); | |
| void _rbfmodel_clear(rbfmodel* p); | | void _rbfmodel_clear(rbfmodel* p); | |
| ae_bool _rbfreport_init(rbfreport* p, ae_state *_state, ae_bool make_automa
tic); | | ae_bool _rbfreport_init(rbfreport* p, ae_state *_state, ae_bool make_automa
tic); | |
| ae_bool _rbfreport_init_copy(rbfreport* dst, rbfreport* src, ae_state *_sta
te, ae_bool make_automatic); | | ae_bool _rbfreport_init_copy(rbfreport* dst, rbfreport* src, ae_state *_sta
te, ae_bool make_automatic); | |
| void _rbfreport_clear(rbfreport* p); | | void _rbfreport_clear(rbfreport* p); | |
|
| void spline2dbuildbilinear(/* Real */ ae_vector* x, | | | |
| /* Real */ ae_vector* y, | | | |
| /* Real */ ae_matrix* f, | | | |
| ae_int_t m, | | | |
| ae_int_t n, | | | |
| spline2dinterpolant* c, | | | |
| ae_state *_state); | | | |
| void spline2dbuildbicubic(/* Real */ ae_vector* x, | | | |
| /* Real */ ae_vector* y, | | | |
| /* Real */ ae_matrix* f, | | | |
| ae_int_t m, | | | |
| ae_int_t n, | | | |
| spline2dinterpolant* c, | | | |
| ae_state *_state); | | | |
| double spline2dcalc(spline2dinterpolant* c, | | double spline2dcalc(spline2dinterpolant* c, | |
| double x, | | double x, | |
| double y, | | double y, | |
| ae_state *_state); | | ae_state *_state); | |
| void spline2ddiff(spline2dinterpolant* c, | | void spline2ddiff(spline2dinterpolant* c, | |
| double x, | | double x, | |
| double y, | | double y, | |
| double* f, | | double* f, | |
| double* fx, | | double* fx, | |
| double* fy, | | double* fy, | |
| double* fxy, | | double* fxy, | |
| ae_state *_state); | | ae_state *_state); | |
|
| void spline2dunpack(spline2dinterpolant* c, | | | |
| ae_int_t* m, | | | |
| ae_int_t* n, | | | |
| /* Real */ ae_matrix* tbl, | | | |
| ae_state *_state); | | | |
| void spline2dlintransxy(spline2dinterpolant* c, | | void spline2dlintransxy(spline2dinterpolant* c, | |
| double ax, | | double ax, | |
| double bx, | | double bx, | |
| double ay, | | double ay, | |
| double by, | | double by, | |
| ae_state *_state); | | ae_state *_state); | |
| void spline2dlintransf(spline2dinterpolant* c, | | void spline2dlintransf(spline2dinterpolant* c, | |
| double a, | | double a, | |
| double b, | | double b, | |
| ae_state *_state); | | ae_state *_state); | |
| | | | |
| skipping to change at line 4918 | | skipping to change at line 5354 | |
| ae_int_t newheight, | | ae_int_t newheight, | |
| ae_int_t newwidth, | | ae_int_t newwidth, | |
| ae_state *_state); | | ae_state *_state); | |
| void spline2dresamplebilinear(/* Real */ ae_matrix* a, | | void spline2dresamplebilinear(/* Real */ ae_matrix* a, | |
| ae_int_t oldheight, | | ae_int_t oldheight, | |
| ae_int_t oldwidth, | | ae_int_t oldwidth, | |
| /* Real */ ae_matrix* b, | | /* Real */ ae_matrix* b, | |
| ae_int_t newheight, | | ae_int_t newheight, | |
| ae_int_t newwidth, | | ae_int_t newwidth, | |
| ae_state *_state); | | ae_state *_state); | |
|
| | | void spline2dbuildbilinearv(/* Real */ ae_vector* x, | |
| | | ae_int_t n, | |
| | | /* Real */ ae_vector* y, | |
| | | ae_int_t m, | |
| | | /* Real */ ae_vector* f, | |
| | | ae_int_t d, | |
| | | spline2dinterpolant* c, | |
| | | ae_state *_state); | |
| | | void spline2dbuildbicubicv(/* Real */ ae_vector* x, | |
| | | ae_int_t n, | |
| | | /* Real */ ae_vector* y, | |
| | | ae_int_t m, | |
| | | /* Real */ ae_vector* f, | |
| | | ae_int_t d, | |
| | | spline2dinterpolant* c, | |
| | | ae_state *_state); | |
| | | void spline2dcalcvbuf(spline2dinterpolant* c, | |
| | | double x, | |
| | | double y, | |
| | | /* Real */ ae_vector* f, | |
| | | ae_state *_state); | |
| | | void spline2dcalcv(spline2dinterpolant* c, | |
| | | double x, | |
| | | double y, | |
| | | /* Real */ ae_vector* f, | |
| | | ae_state *_state); | |
| | | void spline2dunpackv(spline2dinterpolant* c, | |
| | | ae_int_t* m, | |
| | | ae_int_t* n, | |
| | | ae_int_t* d, | |
| | | /* Real */ ae_matrix* tbl, | |
| | | ae_state *_state); | |
| | | void spline2dbuildbilinear(/* Real */ ae_vector* x, | |
| | | /* Real */ ae_vector* y, | |
| | | /* Real */ ae_matrix* f, | |
| | | ae_int_t m, | |
| | | ae_int_t n, | |
| | | spline2dinterpolant* c, | |
| | | ae_state *_state); | |
| | | void spline2dbuildbicubic(/* Real */ ae_vector* x, | |
| | | /* Real */ ae_vector* y, | |
| | | /* Real */ ae_matrix* f, | |
| | | ae_int_t m, | |
| | | ae_int_t n, | |
| | | spline2dinterpolant* c, | |
| | | ae_state *_state); | |
| | | void spline2dunpack(spline2dinterpolant* c, | |
| | | ae_int_t* m, | |
| | | ae_int_t* n, | |
| | | /* Real */ ae_matrix* tbl, | |
| | | ae_state *_state); | |
| ae_bool _spline2dinterpolant_init(spline2dinterpolant* p, ae_state *_state,
ae_bool make_automatic); | | ae_bool _spline2dinterpolant_init(spline2dinterpolant* p, ae_state *_state,
ae_bool make_automatic); | |
| ae_bool _spline2dinterpolant_init_copy(spline2dinterpolant* dst, spline2din
terpolant* src, ae_state *_state, ae_bool make_automatic); | | ae_bool _spline2dinterpolant_init_copy(spline2dinterpolant* dst, spline2din
terpolant* src, ae_state *_state, ae_bool make_automatic); | |
| void _spline2dinterpolant_clear(spline2dinterpolant* p); | | void _spline2dinterpolant_clear(spline2dinterpolant* p); | |
|
| | | double spline3dcalc(spline3dinterpolant* c, | |
| | | double x, | |
| | | double y, | |
| | | double z, | |
| | | ae_state *_state); | |
| | | void spline3dlintransxyz(spline3dinterpolant* c, | |
| | | double ax, | |
| | | double bx, | |
| | | double ay, | |
| | | double by, | |
| | | double az, | |
| | | double bz, | |
| | | ae_state *_state); | |
| | | void spline3dlintransf(spline3dinterpolant* c, | |
| | | double a, | |
| | | double b, | |
| | | ae_state *_state); | |
| | | void spline3dcopy(spline3dinterpolant* c, | |
| | | spline3dinterpolant* cc, | |
| | | ae_state *_state); | |
| | | void spline3dresampletrilinear(/* Real */ ae_vector* a, | |
| | | ae_int_t oldzcount, | |
| | | ae_int_t oldycount, | |
| | | ae_int_t oldxcount, | |
| | | ae_int_t newzcount, | |
| | | ae_int_t newycount, | |
| | | ae_int_t newxcount, | |
| | | /* Real */ ae_vector* b, | |
| | | ae_state *_state); | |
| | | void spline3dbuildtrilinearv(/* Real */ ae_vector* x, | |
| | | ae_int_t n, | |
| | | /* Real */ ae_vector* y, | |
| | | ae_int_t m, | |
| | | /* Real */ ae_vector* z, | |
| | | ae_int_t l, | |
| | | /* Real */ ae_vector* f, | |
| | | ae_int_t d, | |
| | | spline3dinterpolant* c, | |
| | | ae_state *_state); | |
| | | void spline3dcalcvbuf(spline3dinterpolant* c, | |
| | | double x, | |
| | | double y, | |
| | | double z, | |
| | | /* Real */ ae_vector* f, | |
| | | ae_state *_state); | |
| | | void spline3dcalcv(spline3dinterpolant* c, | |
| | | double x, | |
| | | double y, | |
| | | double z, | |
| | | /* Real */ ae_vector* f, | |
| | | ae_state *_state); | |
| | | void spline3dunpackv(spline3dinterpolant* c, | |
| | | ae_int_t* n, | |
| | | ae_int_t* m, | |
| | | ae_int_t* l, | |
| | | ae_int_t* d, | |
| | | ae_int_t* stype, | |
| | | /* Real */ ae_matrix* tbl, | |
| | | ae_state *_state); | |
| | | ae_bool _spline3dinterpolant_init(spline3dinterpolant* p, ae_state *_state, | |
| | | ae_bool make_automatic); | |
| | | ae_bool _spline3dinterpolant_init_copy(spline3dinterpolant* dst, spline3din | |
| | | terpolant* src, ae_state *_state, ae_bool make_automatic); | |
| | | void _spline3dinterpolant_clear(spline3dinterpolant* p); | |
| | | | |
| } | | } | |
| #endif | | #endif | |
| | | | |
End of changes. 23 change blocks. |
| 94 lines changed or deleted | | 672 lines changed or added | |
|
| optimization.h | | optimization.h | |
| | | | |
| skipping to change at line 81 | | skipping to change at line 81 | |
| ae_int_t rstimer; | | ae_int_t rstimer; | |
| ae_vector x; | | ae_vector x; | |
| double f; | | double f; | |
| ae_vector g; | | ae_vector g; | |
| ae_bool needf; | | ae_bool needf; | |
| ae_bool needfg; | | ae_bool needfg; | |
| ae_bool xupdated; | | ae_bool xupdated; | |
| ae_bool algpowerup; | | ae_bool algpowerup; | |
| ae_bool lsstart; | | ae_bool lsstart; | |
| ae_bool lsend; | | ae_bool lsend; | |
|
| | | double teststep; | |
| rcommstate rstate; | | rcommstate rstate; | |
| ae_int_t repiterationscount; | | ae_int_t repiterationscount; | |
| ae_int_t repnfev; | | ae_int_t repnfev; | |
|
| | | ae_int_t repvaridx; | |
| ae_int_t repterminationtype; | | ae_int_t repterminationtype; | |
| ae_int_t debugrestartscount; | | ae_int_t debugrestartscount; | |
| linminstate lstate; | | linminstate lstate; | |
| double fbase; | | double fbase; | |
| double fm2; | | double fm2; | |
| double fm1; | | double fm1; | |
| double fp1; | | double fp1; | |
| double fp2; | | double fp2; | |
| double betahs; | | double betahs; | |
| double betady; | | double betady; | |
| ae_vector work0; | | ae_vector work0; | |
| ae_vector work1; | | ae_vector work1; | |
| } mincgstate; | | } mincgstate; | |
| typedef struct | | typedef struct | |
| { | | { | |
| ae_int_t iterationscount; | | ae_int_t iterationscount; | |
| ae_int_t nfev; | | ae_int_t nfev; | |
|
| | | ae_int_t varidx; | |
| ae_int_t terminationtype; | | ae_int_t terminationtype; | |
| } mincgreport; | | } mincgreport; | |
| typedef struct | | typedef struct | |
| { | | { | |
| ae_int_t nmain; | | ae_int_t nmain; | |
| ae_int_t nslack; | | ae_int_t nslack; | |
| double innerepsg; | | double innerepsg; | |
| double innerepsf; | | double innerepsf; | |
| double innerepsx; | | double innerepsx; | |
| double outerepsx; | | double outerepsx; | |
| | | | |
| skipping to change at line 125 | | skipping to change at line 128 | |
| double diffstep; | | double diffstep; | |
| ae_int_t prectype; | | ae_int_t prectype; | |
| ae_vector diaghoriginal; | | ae_vector diaghoriginal; | |
| ae_vector diagh; | | ae_vector diagh; | |
| ae_vector x; | | ae_vector x; | |
| double f; | | double f; | |
| ae_vector g; | | ae_vector g; | |
| ae_bool needf; | | ae_bool needf; | |
| ae_bool needfg; | | ae_bool needfg; | |
| ae_bool xupdated; | | ae_bool xupdated; | |
|
| | | double teststep; | |
| rcommstate rstate; | | rcommstate rstate; | |
| ae_int_t repinneriterationscount; | | ae_int_t repinneriterationscount; | |
| ae_int_t repouteriterationscount; | | ae_int_t repouteriterationscount; | |
| ae_int_t repnfev; | | ae_int_t repnfev; | |
|
| | | ae_int_t repvaridx; | |
| ae_int_t repterminationtype; | | ae_int_t repterminationtype; | |
| double repdebugeqerr; | | double repdebugeqerr; | |
| double repdebugfs; | | double repdebugfs; | |
| double repdebugff; | | double repdebugff; | |
| double repdebugdx; | | double repdebugdx; | |
| ae_int_t repdebugfeasqpits; | | ae_int_t repdebugfeasqpits; | |
| ae_int_t repdebugfeasgpaits; | | ae_int_t repdebugfeasgpaits; | |
| ae_vector xcur; | | ae_vector xcur; | |
| ae_vector xprev; | | ae_vector xprev; | |
| ae_vector xstart; | | ae_vector xstart; | |
| | | | |
| skipping to change at line 167 | | skipping to change at line 172 | |
| ae_vector constrainedvalues; | | ae_vector constrainedvalues; | |
| ae_vector transforms; | | ae_vector transforms; | |
| ae_vector seffective; | | ae_vector seffective; | |
| ae_vector soriginal; | | ae_vector soriginal; | |
| ae_vector w; | | ae_vector w; | |
| ae_vector tmp0; | | ae_vector tmp0; | |
| ae_vector tmp1; | | ae_vector tmp1; | |
| ae_vector tmp2; | | ae_vector tmp2; | |
| ae_vector r; | | ae_vector r; | |
| ae_matrix lmmatrix; | | ae_matrix lmmatrix; | |
|
| double v0; | | | |
| double v1; | | | |
| double v2; | | | |
| double t; | | | |
| double errfeas; | | double errfeas; | |
| double gnorm; | | double gnorm; | |
| double mpgnorm; | | double mpgnorm; | |
| double mba; | | double mba; | |
| ae_int_t variabletofreeze; | | ae_int_t variabletofreeze; | |
| double valuetofreeze; | | double valuetofreeze; | |
| double fbase; | | double fbase; | |
| double fm2; | | double fm2; | |
| double fm1; | | double fm1; | |
| double fp1; | | double fp1; | |
| | | | |
| skipping to change at line 193 | | skipping to change at line 194 | |
| double xp1; | | double xp1; | |
| mincgstate cgstate; | | mincgstate cgstate; | |
| mincgreport cgrep; | | mincgreport cgrep; | |
| ae_int_t optdim; | | ae_int_t optdim; | |
| } minbleicstate; | | } minbleicstate; | |
| typedef struct | | typedef struct | |
| { | | { | |
| ae_int_t inneriterationscount; | | ae_int_t inneriterationscount; | |
| ae_int_t outeriterationscount; | | ae_int_t outeriterationscount; | |
| ae_int_t nfev; | | ae_int_t nfev; | |
|
| | | ae_int_t varidx; | |
| ae_int_t terminationtype; | | ae_int_t terminationtype; | |
| double debugeqerr; | | double debugeqerr; | |
| double debugfs; | | double debugfs; | |
| double debugff; | | double debugff; | |
| double debugdx; | | double debugdx; | |
| ae_int_t debugfeasqpits; | | ae_int_t debugfeasqpits; | |
| ae_int_t debugfeasgpaits; | | ae_int_t debugfeasgpaits; | |
| } minbleicreport; | | } minbleicreport; | |
| typedef struct | | typedef struct | |
| { | | { | |
| | | | |
| skipping to change at line 243 | | skipping to change at line 245 | |
| double fm1; | | double fm1; | |
| double fp1; | | double fp1; | |
| double fp2; | | double fp2; | |
| ae_vector autobuf; | | ae_vector autobuf; | |
| ae_vector x; | | ae_vector x; | |
| double f; | | double f; | |
| ae_vector g; | | ae_vector g; | |
| ae_bool needf; | | ae_bool needf; | |
| ae_bool needfg; | | ae_bool needfg; | |
| ae_bool xupdated; | | ae_bool xupdated; | |
|
| | | double teststep; | |
| rcommstate rstate; | | rcommstate rstate; | |
| ae_int_t repiterationscount; | | ae_int_t repiterationscount; | |
| ae_int_t repnfev; | | ae_int_t repnfev; | |
|
| | | ae_int_t repvaridx; | |
| ae_int_t repterminationtype; | | ae_int_t repterminationtype; | |
| linminstate lstate; | | linminstate lstate; | |
| } minlbfgsstate; | | } minlbfgsstate; | |
| typedef struct | | typedef struct | |
| { | | { | |
| ae_int_t iterationscount; | | ae_int_t iterationscount; | |
| ae_int_t nfev; | | ae_int_t nfev; | |
|
| | | ae_int_t varidx; | |
| ae_int_t terminationtype; | | ae_int_t terminationtype; | |
| } minlbfgsreport; | | } minlbfgsreport; | |
| typedef struct | | typedef struct | |
| { | | { | |
| ae_int_t n; | | ae_int_t n; | |
|
| | | ae_int_t k; | |
| | | double alpha; | |
| | | double tau; | |
| | | double theta; | |
| | | ae_matrix a; | |
| | | ae_matrix q; | |
| | | ae_vector b; | |
| | | ae_vector r; | |
| | | ae_vector xc; | |
| | | ae_vector d; | |
| | | ae_vector activeset; | |
| | | ae_matrix tq2dense; | |
| | | ae_matrix tk2; | |
| | | ae_vector tq2diag; | |
| | | ae_vector tq1; | |
| | | ae_vector tk1; | |
| | | double tq0; | |
| | | double tk0; | |
| | | ae_vector txc; | |
| | | ae_vector tb; | |
| | | ae_int_t nfree; | |
| | | ae_int_t ecakind; | |
| | | ae_matrix ecadense; | |
| | | ae_matrix eq; | |
| | | ae_matrix eccm; | |
| | | ae_vector ecadiag; | |
| | | ae_vector eb; | |
| | | double ec; | |
| | | ae_vector tmp0; | |
| | | ae_vector tmp1; | |
| | | ae_vector tmpg; | |
| | | ae_matrix tmp2; | |
| | | ae_bool ismaintermchanged; | |
| | | ae_bool issecondarytermchanged; | |
| | | ae_bool islineartermchanged; | |
| | | ae_bool isactivesetchanged; | |
| | | } convexquadraticmodel; | |
| | | typedef struct | |
| | | { | |
| | | ae_int_t n; | |
| ae_int_t algokind; | | ae_int_t algokind; | |
|
| ae_int_t akind; | | convexquadraticmodel a; | |
| ae_matrix densea; | | double anorm; | |
| ae_vector b; | | ae_vector b; | |
| ae_vector bndl; | | ae_vector bndl; | |
| ae_vector bndu; | | ae_vector bndu; | |
| ae_vector havebndl; | | ae_vector havebndl; | |
| ae_vector havebndu; | | ae_vector havebndu; | |
| ae_vector xorigin; | | ae_vector xorigin; | |
| ae_vector startx; | | ae_vector startx; | |
| ae_bool havex; | | ae_bool havex; | |
|
| | | ae_matrix cmatrix; | |
| | | ae_vector cr; | |
| | | ae_vector ct; | |
| | | ae_int_t ccount; | |
| | | ae_matrix cleic; | |
| | | ae_int_t nec; | |
| | | ae_int_t nic; | |
| ae_vector xc; | | ae_vector xc; | |
| ae_vector gc; | | ae_vector gc; | |
|
| ae_vector dc; | | | |
| ae_vector xcand0; | | | |
| ae_vector xcand1; | | | |
| ae_vector xn; | | ae_vector xn; | |
| ae_vector pg; | | ae_vector pg; | |
|
| ae_vector activeset; | | ae_vector activelin; | |
| double constterm; | | ae_vector activeb; | |
| | | ae_matrix activecm; | |
| | | ae_vector activecr; | |
| | | ae_int_t activelincnt; | |
| ae_vector workbndl; | | ae_vector workbndl; | |
| ae_vector workbndu; | | ae_vector workbndu; | |
|
| | | ae_matrix workcleic; | |
| ae_int_t repinneriterationscount; | | ae_int_t repinneriterationscount; | |
| ae_int_t repouteriterationscount; | | ae_int_t repouteriterationscount; | |
| ae_int_t repncholesky; | | ae_int_t repncholesky; | |
| ae_int_t repnmv; | | ae_int_t repnmv; | |
| ae_int_t repterminationtype; | | ae_int_t repterminationtype; | |
| ae_vector tmp0; | | ae_vector tmp0; | |
| ae_vector tmp1; | | ae_vector tmp1; | |
|
| ae_vector itmp0; | | ae_vector tmpfeas; | |
| ae_vector p2; | | ae_matrix tmpm0; | |
| ae_matrix bufa; | | ae_matrix lstransform; | |
| ae_vector bufb; | | ae_matrix lagrangesystem; | |
| ae_vector bufx; | | ae_matrix lagrangesystemtmp; | |
| apbuffers buf; | | ae_vector prevactiveb; | |
| | | ae_vector prevactivelin; | |
| | | ae_vector lsrightpart; | |
| | | ae_vector lsrightparttmp; | |
| | | ae_vector lagrangecoeffs; | |
| | | ae_vector lstmp0; | |
| | | ae_vector lstmp1; | |
| | | normestimatorstate estimator; | |
| } minqpstate; | | } minqpstate; | |
| typedef struct | | typedef struct | |
| { | | { | |
| ae_int_t inneriterationscount; | | ae_int_t inneriterationscount; | |
| ae_int_t outeriterationscount; | | ae_int_t outeriterationscount; | |
| ae_int_t nmv; | | ae_int_t nmv; | |
| ae_int_t ncholesky; | | ae_int_t ncholesky; | |
| ae_int_t terminationtype; | | ae_int_t terminationtype; | |
| } minqpreport; | | } minqpreport; | |
| typedef struct | | typedef struct | |
| | | | |
| skipping to change at line 349 | | skipping to change at line 409 | |
| ae_vector havebndu; | | ae_vector havebndu; | |
| ae_vector s; | | ae_vector s; | |
| double lambdav; | | double lambdav; | |
| double nu; | | double nu; | |
| ae_int_t modelage; | | ae_int_t modelage; | |
| ae_vector xdir; | | ae_vector xdir; | |
| ae_vector deltax; | | ae_vector deltax; | |
| ae_vector deltaf; | | ae_vector deltaf; | |
| ae_bool deltaxready; | | ae_bool deltaxready; | |
| ae_bool deltafready; | | ae_bool deltafready; | |
|
| | | double teststep; | |
| ae_int_t repiterationscount; | | ae_int_t repiterationscount; | |
| ae_int_t repterminationtype; | | ae_int_t repterminationtype; | |
|
| | | ae_int_t repfuncidx; | |
| | | ae_int_t repvaridx; | |
| ae_int_t repnfunc; | | ae_int_t repnfunc; | |
| ae_int_t repnjac; | | ae_int_t repnjac; | |
| ae_int_t repngrad; | | ae_int_t repngrad; | |
| ae_int_t repnhess; | | ae_int_t repnhess; | |
| ae_int_t repncholesky; | | ae_int_t repncholesky; | |
| rcommstate rstate; | | rcommstate rstate; | |
| ae_vector choleskybuf; | | ae_vector choleskybuf; | |
| ae_vector tmp0; | | ae_vector tmp0; | |
| double actualdecrease; | | double actualdecrease; | |
| double predicteddecrease; | | double predicteddecrease; | |
| double xm1; | | double xm1; | |
| double xp1; | | double xp1; | |
| ae_vector fm1; | | ae_vector fm1; | |
| ae_vector fp1; | | ae_vector fp1; | |
|
| | | ae_vector fc1; | |
| | | ae_vector gm1; | |
| | | ae_vector gp1; | |
| | | ae_vector gc1; | |
| minlbfgsstate internalstate; | | minlbfgsstate internalstate; | |
| minlbfgsreport internalrep; | | minlbfgsreport internalrep; | |
| minqpstate qpstate; | | minqpstate qpstate; | |
| minqpreport qprep; | | minqpreport qprep; | |
| } minlmstate; | | } minlmstate; | |
| typedef struct | | typedef struct | |
| { | | { | |
| ae_int_t iterationscount; | | ae_int_t iterationscount; | |
| ae_int_t terminationtype; | | ae_int_t terminationtype; | |
|
| | | ae_int_t funcidx; | |
| | | ae_int_t varidx; | |
| ae_int_t nfunc; | | ae_int_t nfunc; | |
| ae_int_t njac; | | ae_int_t njac; | |
| ae_int_t ngrad; | | ae_int_t ngrad; | |
| ae_int_t nhess; | | ae_int_t nhess; | |
| ae_int_t ncholesky; | | ae_int_t ncholesky; | |
| } minlmreport; | | } minlmreport; | |
| typedef struct | | typedef struct | |
| { | | { | |
| ae_int_t n; | | ae_int_t n; | |
| double epsg; | | double epsg; | |
| | | | |
| skipping to change at line 502 | | skipping to change at line 571 | |
| }; | | }; | |
| class mincgreport : public _mincgreport_owner | | class mincgreport : public _mincgreport_owner | |
| { | | { | |
| public: | | public: | |
| mincgreport(); | | mincgreport(); | |
| mincgreport(const mincgreport &rhs); | | mincgreport(const mincgreport &rhs); | |
| mincgreport& operator=(const mincgreport &rhs); | | mincgreport& operator=(const mincgreport &rhs); | |
| virtual ~mincgreport(); | | virtual ~mincgreport(); | |
| ae_int_t &iterationscount; | | ae_int_t &iterationscount; | |
| ae_int_t &nfev; | | ae_int_t &nfev; | |
|
| | | ae_int_t &varidx; | |
| ae_int_t &terminationtype; | | ae_int_t &terminationtype; | |
| | | | |
| }; | | }; | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| This object stores nonlinear optimizer state. | | This object stores nonlinear optimizer state. | |
| You should use functions provided by MinBLEIC subpackage to work with this | | You should use functions provided by MinBLEIC subpackage to work with this | |
| object | | object | |
| *************************************************************************/ | | *************************************************************************/ | |
| class _minbleicstate_owner | | class _minbleicstate_owner | |
| | | | |
| skipping to change at line 555 | | skipping to change at line 625 | |
| | | | |
| TERMINATION CODES | | TERMINATION CODES | |
| | | | |
| TerminationType field contains completion code, which can be: | | TerminationType field contains completion code, which can be: | |
| -10 unsupported combination of algorithm settings: | | -10 unsupported combination of algorithm settings: | |
| 1) StpMax is set to non-zero value, | | 1) StpMax is set to non-zero value, | |
| AND 2) non-default preconditioner is used. | | AND 2) non-default preconditioner is used. | |
| You can't use both features at the same moment, | | You can't use both features at the same moment, | |
| so you have to choose one of them (and to turn | | so you have to choose one of them (and to turn | |
| off another one). | | off another one). | |
|
| | | -7 gradient verification failed. | |
| | | See MinBLEICSetGradientCheck() for more information. | |
| -3 inconsistent constraints. Feasible point is | | -3 inconsistent constraints. Feasible point is | |
| either nonexistent or too hard to find. Try to | | either nonexistent or too hard to find. Try to | |
| restart optimizer with better initial | | restart optimizer with better initial | |
| approximation | | approximation | |
| 4 conditions on constraints are fulfilled | | 4 conditions on constraints are fulfilled | |
| with error less than or equal to EpsC | | with error less than or equal to EpsC | |
| 5 MaxIts steps was taken | | 5 MaxIts steps was taken | |
| 7 stopping conditions are too stringent, | | 7 stopping conditions are too stringent, | |
| further improvement is impossible, | | further improvement is impossible, | |
| X contains best point found so far. | | X contains best point found so far. | |
| | | | |
| skipping to change at line 597 | | skipping to change at line 669 | |
| class minbleicreport : public _minbleicreport_owner | | class minbleicreport : public _minbleicreport_owner | |
| { | | { | |
| public: | | public: | |
| minbleicreport(); | | minbleicreport(); | |
| minbleicreport(const minbleicreport &rhs); | | minbleicreport(const minbleicreport &rhs); | |
| minbleicreport& operator=(const minbleicreport &rhs); | | minbleicreport& operator=(const minbleicreport &rhs); | |
| virtual ~minbleicreport(); | | virtual ~minbleicreport(); | |
| ae_int_t &inneriterationscount; | | ae_int_t &inneriterationscount; | |
| ae_int_t &outeriterationscount; | | ae_int_t &outeriterationscount; | |
| ae_int_t &nfev; | | ae_int_t &nfev; | |
|
| | | ae_int_t &varidx; | |
| ae_int_t &terminationtype; | | ae_int_t &terminationtype; | |
| double &debugeqerr; | | double &debugeqerr; | |
| double &debugfs; | | double &debugfs; | |
| double &debugff; | | double &debugff; | |
| double &debugdx; | | double &debugdx; | |
| ae_int_t &debugfeasqpits; | | ae_int_t &debugfeasqpits; | |
| ae_int_t &debugfeasgpaits; | | ae_int_t &debugfeasgpaits; | |
| | | | |
| }; | | }; | |
| | | | |
| | | | |
| skipping to change at line 662 | | skipping to change at line 735 | |
| }; | | }; | |
| class minlbfgsreport : public _minlbfgsreport_owner | | class minlbfgsreport : public _minlbfgsreport_owner | |
| { | | { | |
| public: | | public: | |
| minlbfgsreport(); | | minlbfgsreport(); | |
| minlbfgsreport(const minlbfgsreport &rhs); | | minlbfgsreport(const minlbfgsreport &rhs); | |
| minlbfgsreport& operator=(const minlbfgsreport &rhs); | | minlbfgsreport& operator=(const minlbfgsreport &rhs); | |
| virtual ~minlbfgsreport(); | | virtual ~minlbfgsreport(); | |
| ae_int_t &iterationscount; | | ae_int_t &iterationscount; | |
| ae_int_t &nfev; | | ae_int_t &nfev; | |
|
| | | ae_int_t &varidx; | |
| ae_int_t &terminationtype; | | ae_int_t &terminationtype; | |
| | | | |
| }; | | }; | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| This object stores nonlinear optimizer state. | | This object stores nonlinear optimizer state. | |
| You should use functions provided by MinQP subpackage to work with this | | You should use functions provided by MinQP subpackage to work with this | |
| object | | object | |
| *************************************************************************/ | | *************************************************************************/ | |
| class _minqpstate_owner | | class _minqpstate_owner | |
| | | | |
| skipping to change at line 790 | | skipping to change at line 864 | |
| real_2d_array j; | | real_2d_array j; | |
| real_1d_array x; | | real_1d_array x; | |
| | | | |
| }; | | }; | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| Optimization report, filled by MinLMResults() function | | Optimization report, filled by MinLMResults() function | |
| | | | |
| FIELDS: | | FIELDS: | |
| * TerminationType, completetion code: | | * TerminationType, completetion code: | |
|
| * -9 derivative correctness check failed; | | * -7 derivative correctness check failed; | |
| see Rep.WrongNum, Rep.WrongI, Rep.WrongJ for | | see Rep.WrongNum, Rep.WrongI, Rep.WrongJ for | |
| more information. | | more information. | |
| * 1 relative function improvement is no more than | | * 1 relative function improvement is no more than | |
| EpsF. | | EpsF. | |
| * 2 relative step is no more than EpsX. | | * 2 relative step is no more than EpsX. | |
| * 4 gradient is no more than EpsG. | | * 4 gradient is no more than EpsG. | |
| * 5 MaxIts steps was taken | | * 5 MaxIts steps was taken | |
| * 7 stopping conditions are too stringent, | | * 7 stopping conditions are too stringent, | |
| further improvement is impossible | | further improvement is impossible | |
| * IterationsCount, contains iterations count | | * IterationsCount, contains iterations count | |
| | | | |
| skipping to change at line 828 | | skipping to change at line 902 | |
| }; | | }; | |
| class minlmreport : public _minlmreport_owner | | class minlmreport : public _minlmreport_owner | |
| { | | { | |
| public: | | public: | |
| minlmreport(); | | minlmreport(); | |
| minlmreport(const minlmreport &rhs); | | minlmreport(const minlmreport &rhs); | |
| minlmreport& operator=(const minlmreport &rhs); | | minlmreport& operator=(const minlmreport &rhs); | |
| virtual ~minlmreport(); | | virtual ~minlmreport(); | |
| ae_int_t &iterationscount; | | ae_int_t &iterationscount; | |
| ae_int_t &terminationtype; | | ae_int_t &terminationtype; | |
|
| | | ae_int_t &funcidx; | |
| | | ae_int_t &varidx; | |
| ae_int_t &nfunc; | | ae_int_t &nfunc; | |
| ae_int_t &njac; | | ae_int_t &njac; | |
| ae_int_t &ngrad; | | ae_int_t &ngrad; | |
| ae_int_t &nhess; | | ae_int_t &nhess; | |
| ae_int_t &ncholesky; | | ae_int_t &ncholesky; | |
| | | | |
| }; | | }; | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| | | | |
| | | | |
| skipping to change at line 1267 | | skipping to change at line 1343 | |
| /************************************************************************* | | /************************************************************************* | |
| Conjugate gradient results | | Conjugate gradient results | |
| | | | |
| INPUT PARAMETERS: | | INPUT PARAMETERS: | |
| State - algorithm state | | State - algorithm state | |
| | | | |
| OUTPUT PARAMETERS: | | OUTPUT PARAMETERS: | |
| X - array[0..N-1], solution | | X - array[0..N-1], solution | |
| Rep - optimization report: | | Rep - optimization report: | |
| * Rep.TerminationType completetion code: | | * Rep.TerminationType completetion code: | |
|
| | | * -7 gradient verification failed. | |
| | | See MinCGSetGradientCheck() for more informatio | |
| | | n. | |
| * 1 relative function improvement is no more than | | * 1 relative function improvement is no more than | |
| EpsF. | | EpsF. | |
| * 2 relative step is no more than EpsX. | | * 2 relative step is no more than EpsX. | |
| * 4 gradient norm is no more than EpsG | | * 4 gradient norm is no more than EpsG | |
| * 5 MaxIts steps was taken | | * 5 MaxIts steps was taken | |
| * 7 stopping conditions are too stringent, | | * 7 stopping conditions are too stringent, | |
| further improvement is impossible, | | further improvement is impossible, | |
| we return best X found so far | | we return best X found so far | |
| * 8 terminated by user | | * 8 terminated by user | |
| * Rep.IterationsCount contains iterations count | | * Rep.IterationsCount contains iterations count | |
| | | | |
| skipping to change at line 1314 | | skipping to change at line 1392 | |
| INPUT PARAMETERS: | | INPUT PARAMETERS: | |
| State - structure used to store algorithm state. | | State - structure used to store algorithm state. | |
| X - new starting point. | | X - new starting point. | |
| | | | |
| -- ALGLIB -- | | -- ALGLIB -- | |
| Copyright 30.07.2010 by Bochkanov Sergey | | Copyright 30.07.2010 by Bochkanov Sergey | |
| *************************************************************************/ | | *************************************************************************/ | |
| void mincgrestartfrom(const mincgstate &state, const real_1d_array &x); | | void mincgrestartfrom(const mincgstate &state, const real_1d_array &x); | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
|
| | | | |
| | | This subroutine turns on verification of the user-supplied analytic | |
| | | gradient: | |
| | | * user calls this subroutine before optimization begins | |
| | | * MinCGOptimize() is called | |
| | | * prior to actual optimization, for each component of parameters being | |
| | | optimized X[i] algorithm performs following steps: | |
| | | * two trial steps are made to X[i]-TestStep*S[i] and X[i]+TestStep*S[i], | |
| | | where X[i] is i-th component of the initial point and S[i] is a scale | |
| | | of i-th parameter | |
| | | * F(X) is evaluated at these trial points | |
| | | * we perform one more evaluation in the middle point of the interval | |
| | | * we build cubic model using function values and derivatives at trial | |
| | | points and we compare its prediction with actual value in the middle | |
| | | point | |
| | | * in case difference between prediction and actual value is higher than | |
| | | some predetermined threshold, algorithm stops with completion code -7; | |
| | | Rep.VarIdx is set to index of the parameter with incorrect derivative. | |
| | | * after verification is over, algorithm proceeds to the actual optimization | |
| | | . | |
| | | | |
| | | NOTE 1: verification needs N (parameters count) gradient evaluations. It | |
| | | is very costly and you should use it only for low dimensional | |
| | | problems, when you want to be sure that you've correctly | |
| | | calculated analytic derivatives. You should not use it in the | |
| | | production code (unless you want to check derivatives provided by | |
| | | some third party). | |
| | | | |
| | | NOTE 2: you should carefully choose TestStep. Value which is too large | |
| | | (so large that function behaviour is significantly non-cubic) will | |
| | | lead to false alarms. You may use different step for different | |
| | | parameters by means of setting scale with MinCGSetScale(). | |
| | | | |
| | | NOTE 3: this function may lead to false positives. In case it reports that | |
| | | I-th derivative was calculated incorrectly, you may decrease test | |
| | | step and try one more time - maybe your function changes too | |
| | | sharply and your step is too large for such rapidly chanding | |
| | | function. | |
| | | | |
| | | INPUT PARAMETERS: | |
| | | State - structure used to store algorithm state | |
| | | TestStep - verification step: | |
| | | * TestStep=0 turns verification off | |
| | | * TestStep>0 activates verification | |
| | | | |
| | | -- ALGLIB -- | |
| | | Copyright 31.05.2012 by Bochkanov Sergey | |
| | | *************************************************************************/ | |
| | | void mincgsetgradientcheck(const mincgstate &state, const double teststep); | |
| | | | |
| | | /************************************************************************* | |
| BOUND CONSTRAINED OPTIMIZATION | | BOUND CONSTRAINED OPTIMIZATION | |
| WITH ADDITIONAL LINEAR EQUALITY AND INEQUALITY CONSTRAINTS | | WITH ADDITIONAL LINEAR EQUALITY AND INEQUALITY CONSTRAINTS | |
| | | | |
| DESCRIPTION: | | DESCRIPTION: | |
| The subroutine minimizes function F(x) of N arguments subject to any | | The subroutine minimizes function F(x) of N arguments subject to any | |
| combination of: | | combination of: | |
| * bound constraints | | * bound constraints | |
| * linear inequality constraints | | * linear inequality constraints | |
| * linear equality constraints | | * linear equality constraints | |
| | | | |
| | | | |
| skipping to change at line 1820 | | skipping to change at line 1948 | |
| INPUT PARAMETERS: | | INPUT PARAMETERS: | |
| State - structure previously allocated with MinBLEICCreate call. | | State - structure previously allocated with MinBLEICCreate call. | |
| X - new starting point. | | X - new starting point. | |
| | | | |
| -- ALGLIB -- | | -- ALGLIB -- | |
| Copyright 28.11.2010 by Bochkanov Sergey | | Copyright 28.11.2010 by Bochkanov Sergey | |
| *************************************************************************/ | | *************************************************************************/ | |
| void minbleicrestartfrom(const minbleicstate &state, const real_1d_array &x
); | | void minbleicrestartfrom(const minbleicstate &state, const real_1d_array &x
); | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
|
| | | This subroutine turns on verification of the user-supplied analytic | |
| | | gradient: | |
| | | * user calls this subroutine before optimization begins | |
| | | * MinBLEICOptimize() is called | |
| | | * prior to actual optimization, for each component of parameters being | |
| | | optimized X[i] algorithm performs following steps: | |
| | | * two trial steps are made to X[i]-TestStep*S[i] and X[i]+TestStep*S[i], | |
| | | where X[i] is i-th component of the initial point and S[i] is a scale | |
| | | of i-th parameter | |
| | | * if needed, steps are bounded with respect to constraints on X[] | |
| | | * F(X) is evaluated at these trial points | |
| | | * we perform one more evaluation in the middle point of the interval | |
| | | * we build cubic model using function values and derivatives at trial | |
| | | points and we compare its prediction with actual value in the middle | |
| | | point | |
| | | * in case difference between prediction and actual value is higher than | |
| | | some predetermined threshold, algorithm stops with completion code -7; | |
| | | Rep.VarIdx is set to index of the parameter with incorrect derivative. | |
| | | * after verification is over, algorithm proceeds to the actual optimization | |
| | | . | |
| | | | |
| | | NOTE 1: verification needs N (parameters count) gradient evaluations. It | |
| | | is very costly and you should use it only for low dimensional | |
| | | problems, when you want to be sure that you've correctly | |
| | | calculated analytic derivatives. You should not use it in the | |
| | | production code (unless you want to check derivatives provided by | |
| | | some third party). | |
| | | | |
| | | NOTE 2: you should carefully choose TestStep. Value which is too large | |
| | | (so large that function behaviour is significantly non-cubic) will | |
| | | lead to false alarms. You may use different step for different | |
| | | parameters by means of setting scale with MinBLEICSetScale(). | |
| | | | |
| | | NOTE 3: this function may lead to false positives. In case it reports that | |
| | | I-th derivative was calculated incorrectly, you may decrease test | |
| | | step and try one more time - maybe your function changes too | |
| | | sharply and your step is too large for such rapidly chanding | |
| | | function. | |
| | | | |
| | | INPUT PARAMETERS: | |
| | | State - structure used to store algorithm state | |
| | | TestStep - verification step: | |
| | | * TestStep=0 turns verification off | |
| | | * TestStep>0 activates verification | |
| | | | |
| | | -- ALGLIB -- | |
| | | Copyright 15.06.2012 by Bochkanov Sergey | |
| | | *************************************************************************/ | |
| | | void minbleicsetgradientcheck(const minbleicstate &state, const double test | |
| | | step); | |
| | | | |
| | | /************************************************************************* | |
| LIMITED MEMORY BFGS METHOD FOR LARGE SCALE OPTIMIZATION | | LIMITED MEMORY BFGS METHOD FOR LARGE SCALE OPTIMIZATION | |
| | | | |
| DESCRIPTION: | | DESCRIPTION: | |
| The subroutine minimizes function F(x) of N arguments by using a quasi- | | The subroutine minimizes function F(x) of N arguments by using a quasi- | |
| Newton method (LBFGS scheme) which is optimized to use a minimum amount | | Newton method (LBFGS scheme) which is optimized to use a minimum amount | |
| of memory. | | of memory. | |
| The subroutine generates the approximation of an inverse Hessian matrix by | | The subroutine generates the approximation of an inverse Hessian matrix by | |
| using information about the last M steps of the algorithm (instead of N). | | using information about the last M steps of the algorithm (instead of N). | |
| It lessens a required amount of memory from a value of order N^2 to a | | It lessens a required amount of memory from a value of order N^2 to a | |
| value of order 2*N*M. | | value of order 2*N*M. | |
| | | | |
| skipping to change at line 2182 | | skipping to change at line 2360 | |
| /************************************************************************* | | /************************************************************************* | |
| L-BFGS algorithm results | | L-BFGS algorithm results | |
| | | | |
| INPUT PARAMETERS: | | INPUT PARAMETERS: | |
| State - algorithm state | | State - algorithm state | |
| | | | |
| OUTPUT PARAMETERS: | | OUTPUT PARAMETERS: | |
| X - array[0..N-1], solution | | X - array[0..N-1], solution | |
| Rep - optimization report: | | Rep - optimization report: | |
| * Rep.TerminationType completetion code: | | * Rep.TerminationType completetion code: | |
|
| | | * -7 gradient verification failed. | |
| | | See MinLBFGSSetGradientCheck() for more informa | |
| | | tion. | |
| * -2 rounding errors prevent further improvement. | | * -2 rounding errors prevent further improvement. | |
| X contains best point found. | | X contains best point found. | |
| * -1 incorrect parameters were specified | | * -1 incorrect parameters were specified | |
| * 1 relative function improvement is no more than | | * 1 relative function improvement is no more than | |
| EpsF. | | EpsF. | |
| * 2 relative step is no more than EpsX. | | * 2 relative step is no more than EpsX. | |
| * 4 gradient norm is no more than EpsG | | * 4 gradient norm is no more than EpsG | |
| * 5 MaxIts steps was taken | | * 5 MaxIts steps was taken | |
| * 7 stopping conditions are too stringent, | | * 7 stopping conditions are too stringent, | |
| further improvement is impossible | | further improvement is impossible | |
| | | | |
| skipping to change at line 2230 | | skipping to change at line 2410 | |
| INPUT PARAMETERS: | | INPUT PARAMETERS: | |
| State - structure used to store algorithm state | | State - structure used to store algorithm state | |
| X - new starting point. | | X - new starting point. | |
| | | | |
| -- ALGLIB -- | | -- ALGLIB -- | |
| Copyright 30.07.2010 by Bochkanov Sergey | | Copyright 30.07.2010 by Bochkanov Sergey | |
| *************************************************************************/ | | *************************************************************************/ | |
| void minlbfgsrestartfrom(const minlbfgsstate &state, const real_1d_array &x
); | | void minlbfgsrestartfrom(const minlbfgsstate &state, const real_1d_array &x
); | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
|
| | | This subroutine turns on verification of the user-supplied analytic | |
| | | gradient: | |
| | | * user calls this subroutine before optimization begins | |
| | | * MinLBFGSOptimize() is called | |
| | | * prior to actual optimization, for each component of parameters being | |
| | | optimized X[i] algorithm performs following steps: | |
| | | * two trial steps are made to X[i]-TestStep*S[i] and X[i]+TestStep*S[i], | |
| | | where X[i] is i-th component of the initial point and S[i] is a scale | |
| | | of i-th parameter | |
| | | * if needed, steps are bounded with respect to constraints on X[] | |
| | | * F(X) is evaluated at these trial points | |
| | | * we perform one more evaluation in the middle point of the interval | |
| | | * we build cubic model using function values and derivatives at trial | |
| | | points and we compare its prediction with actual value in the middle | |
| | | point | |
| | | * in case difference between prediction and actual value is higher than | |
| | | some predetermined threshold, algorithm stops with completion code -7; | |
| | | Rep.VarIdx is set to index of the parameter with incorrect derivative. | |
| | | * after verification is over, algorithm proceeds to the actual optimization | |
| | | . | |
| | | | |
| | | NOTE 1: verification needs N (parameters count) gradient evaluations. It | |
| | | is very costly and you should use it only for low dimensional | |
| | | problems, when you want to be sure that you've correctly | |
| | | calculated analytic derivatives. You should not use it in the | |
| | | production code (unless you want to check derivatives provided by | |
| | | some third party). | |
| | | | |
| | | NOTE 2: you should carefully choose TestStep. Value which is too large | |
| | | (so large that function behaviour is significantly non-cubic) will | |
| | | lead to false alarms. You may use different step for different | |
| | | parameters by means of setting scale with MinLBFGSSetScale(). | |
| | | | |
| | | NOTE 3: this function may lead to false positives. In case it reports that | |
| | | I-th derivative was calculated incorrectly, you may decrease test | |
| | | step and try one more time - maybe your function changes too | |
| | | sharply and your step is too large for such rapidly chanding | |
| | | function. | |
| | | | |
| | | INPUT PARAMETERS: | |
| | | State - structure used to store algorithm state | |
| | | TestStep - verification step: | |
| | | * TestStep=0 turns verification off | |
| | | * TestStep>0 activates verification | |
| | | | |
| | | -- ALGLIB -- | |
| | | Copyright 24.05.2012 by Bochkanov Sergey | |
| | | *************************************************************************/ | |
| | | void minlbfgssetgradientcheck(const minlbfgsstate &state, const double test | |
| | | step); | |
| | | | |
| | | /************************************************************************* | |
| CONSTRAINED QUADRATIC PROGRAMMING | | CONSTRAINED QUADRATIC PROGRAMMING | |
| | | | |
| The subroutine creates QP optimizer. After initial creation, it contains | | The subroutine creates QP optimizer. After initial creation, it contains | |
| default optimization problem with zero quadratic and linear terms and no | | default optimization problem with zero quadratic and linear terms and no | |
| constraints. You should set quadratic/linear terms with calls to functions | | constraints. You should set quadratic/linear terms with calls to functions | |
| provided by MinQP subpackage. | | provided by MinQP subpackage. | |
| | | | |
| INPUT PARAMETERS: | | INPUT PARAMETERS: | |
| N - problem size | | N - problem size | |
| | | | |
| | | | |
| skipping to change at line 2372 | | skipping to change at line 2602 | |
| | | | |
| NOTE: it is possible to specify BndL[i]=BndU[i]. In this case I-th | | NOTE: it is possible to specify BndL[i]=BndU[i]. In this case I-th | |
| variable will be "frozen" at X[i]=BndL[i]=BndU[i]. | | variable will be "frozen" at X[i]=BndL[i]=BndU[i]. | |
| | | | |
| -- ALGLIB -- | | -- ALGLIB -- | |
| Copyright 11.01.2011 by Bochkanov Sergey | | Copyright 11.01.2011 by Bochkanov Sergey | |
| *************************************************************************/ | | *************************************************************************/ | |
| void minqpsetbc(const minqpstate &state, const real_1d_array &bndl, const r
eal_1d_array &bndu); | | void minqpsetbc(const minqpstate &state, const real_1d_array &bndl, const r
eal_1d_array &bndu); | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
|
| | | This function sets linear constraints for QP optimizer. | |
| | | | |
| | | Linear constraints are inactive by default (after initial creation). | |
| | | | |
| | | INPUT PARAMETERS: | |
| | | State - structure previously allocated with MinQPCreate call. | |
| | | C - linear constraints, array[K,N+1]. | |
| | | Each row of C represents one constraint, either equality | |
| | | or inequality (see below): | |
| | | * first N elements correspond to coefficients, | |
| | | * last element corresponds to the right part. | |
| | | All elements of C (including right part) must be finite. | |
| | | CT - type of constraints, array[K]: | |
| | | * if CT[i]>0, then I-th constraint is C[i,*]*x >= C[i,n+1] | |
| | | * if CT[i]=0, then I-th constraint is C[i,*]*x = C[i,n+1] | |
| | | * if CT[i]<0, then I-th constraint is C[i,*]*x <= C[i,n+1] | |
| | | K - number of equality/inequality constraints, K>=0: | |
| | | * if given, only leading K elements of C/CT are used | |
| | | * if not given, automatically determined from sizes of C/CT | |
| | | | |
| | | NOTE 1: linear (non-bound) constraints are satisfied only approximately - | |
| | | there always exists some minor violation (about 10^10...10^13) due | |
| | | to rounding errors. | |
| | | | |
| | | -- ALGLIB -- | |
| | | Copyright 19.06.2012 by Bochkanov Sergey | |
| | | *************************************************************************/ | |
| | | void minqpsetlc(const minqpstate &state, const real_2d_array &c, const inte | |
| | | ger_1d_array &ct, const ae_int_t k); | |
| | | void minqpsetlc(const minqpstate &state, const real_2d_array &c, const inte | |
| | | ger_1d_array &ct); | |
| | | | |
| | | /************************************************************************* | |
| This function solves quadratic programming problem. | | This function solves quadratic programming problem. | |
| You should call it after setting solver options with MinQPSet...() calls. | | You should call it after setting solver options with MinQPSet...() calls. | |
| | | | |
| INPUT PARAMETERS: | | INPUT PARAMETERS: | |
| State - algorithm state | | State - algorithm state | |
| | | | |
| You should use MinQPResults() function to access results after calls | | You should use MinQPResults() function to access results after calls | |
| to this function. | | to this function. | |
| | | | |
| -- ALGLIB -- | | -- ALGLIB -- | |
| | | | |
| skipping to change at line 2936 | | skipping to change at line 3197 | |
| backward compatibility only. We recommend to use MinLMCreateVJ, which | | backward compatibility only. We recommend to use MinLMCreateVJ, which | |
| provides similar, but more consistent and feature-rich interface. | | provides similar, but more consistent and feature-rich interface. | |
| | | | |
| -- ALGLIB -- | | -- ALGLIB -- | |
| Copyright 30.03.2009 by Bochkanov Sergey | | Copyright 30.03.2009 by Bochkanov Sergey | |
| *************************************************************************/ | | *************************************************************************/ | |
| void minlmcreatefj(const ae_int_t n, const ae_int_t m, const real_1d_array
&x, minlmstate &state); | | void minlmcreatefj(const ae_int_t n, const ae_int_t m, const real_1d_array
&x, minlmstate &state); | |
| void minlmcreatefj(const ae_int_t m, const real_1d_array &x, minlmstate &st
ate); | | void minlmcreatefj(const ae_int_t m, const real_1d_array &x, minlmstate &st
ate); | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
|
| | | This subroutine turns on verification of the user-supplied analytic | |
| | | gradient: | |
| | | * user calls this subroutine before optimization begins | |
| | | * MinLMOptimize() is called | |
| | | * prior to actual optimization, for each function Fi and each component | |
| | | of parameters being optimized X[j] algorithm performs following steps: | |
| | | * two trial steps are made to X[j]-TestStep*S[j] and X[j]+TestStep*S[j], | |
| | | where X[j] is j-th parameter and S[j] is a scale of j-th parameter | |
| | | * if needed, steps are bounded with respect to constraints on X[] | |
| | | * Fi(X) is evaluated at these trial points | |
| | | * we perform one more evaluation in the middle point of the interval | |
| | | * we build cubic model using function values and derivatives at trial | |
| | | points and we compare its prediction with actual value in the middle | |
| | | point | |
| | | * in case difference between prediction and actual value is higher than | |
| | | some predetermined threshold, algorithm stops with completion code -7; | |
| | | Rep.VarIdx is set to index of the parameter with incorrect derivative, | |
| | | Rep.FuncIdx is set to index of the function. | |
| | | * after verification is over, algorithm proceeds to the actual optimization | |
| | | . | |
| | | | |
| | | NOTE 1: verification needs N (parameters count) Jacobian evaluations. It | |
| | | is very costly and you should use it only for low dimensional | |
| | | problems, when you want to be sure that you've correctly | |
| | | calculated analytic derivatives. You should not use it in the | |
| | | production code (unless you want to check derivatives provided | |
| | | by some third party). | |
| | | | |
| | | NOTE 2: you should carefully choose TestStep. Value which is too large | |
| | | (so large that function behaviour is significantly non-cubic) will | |
| | | lead to false alarms. You may use different step for different | |
| | | parameters by means of setting scale with MinLMSetScale(). | |
| | | | |
| | | NOTE 3: this function may lead to false positives. In case it reports that | |
| | | I-th derivative was calculated incorrectly, you may decrease test | |
| | | step and try one more time - maybe your function changes too | |
| | | sharply and your step is too large for such rapidly chanding | |
| | | function. | |
| | | | |
| | | INPUT PARAMETERS: | |
| | | State - structure used to store algorithm state | |
| | | TestStep - verification step: | |
| | | * TestStep=0 turns verification off | |
| | | * TestStep>0 activates verification | |
| | | | |
| | | -- ALGLIB -- | |
| | | Copyright 15.06.2012 by Bochkanov Sergey | |
| | | *************************************************************************/ | |
| | | void minlmsetgradientcheck(const minlmstate &state, const double teststep); | |
| | | | |
| | | /************************************************************************* | |
| Obsolete function, use MinLBFGSSetPrecDefault() instead. | | Obsolete function, use MinLBFGSSetPrecDefault() instead. | |
| | | | |
| -- ALGLIB -- | | -- ALGLIB -- | |
| Copyright 13.10.2010 by Bochkanov Sergey | | Copyright 13.10.2010 by Bochkanov Sergey | |
| *************************************************************************/ | | *************************************************************************/ | |
| void minlbfgssetdefaultpreconditioner(const minlbfgsstate &state); | | void minlbfgssetdefaultpreconditioner(const minlbfgsstate &state); | |
| | | | |
| /************************************************************************* | | /************************************************************************* | |
| Obsolete function, use MinLBFGSSetCholeskyPreconditioner() instead. | | Obsolete function, use MinLBFGSSetCholeskyPreconditioner() instead. | |
| | | | |
| | | | |
| skipping to change at line 3160 | | skipping to change at line 3471 | |
| /* Real */ ae_vector* bndu, | | /* Real */ ae_vector* bndu, | |
| /* Boolean */ ae_vector* havebndu, | | /* Boolean */ ae_vector* havebndu, | |
| ae_int_t nmain, | | ae_int_t nmain, | |
| ae_int_t nslack, | | ae_int_t nslack, | |
| /* Real */ ae_matrix* ce, | | /* Real */ ae_matrix* ce, | |
| ae_int_t k, | | ae_int_t k, | |
| double epsi, | | double epsi, | |
| ae_int_t* qpits, | | ae_int_t* qpits, | |
| ae_int_t* gpaits, | | ae_int_t* gpaits, | |
| ae_state *_state); | | ae_state *_state); | |
|
| | | ae_bool derivativecheck(double f0, | |
| | | double df0, | |
| | | double f1, | |
| | | double df1, | |
| | | double f, | |
| | | double df, | |
| | | double width, | |
| | | ae_state *_state); | |
| void mincgcreate(ae_int_t n, | | void mincgcreate(ae_int_t n, | |
| /* Real */ ae_vector* x, | | /* Real */ ae_vector* x, | |
| mincgstate* state, | | mincgstate* state, | |
| ae_state *_state); | | ae_state *_state); | |
| void mincgcreatef(ae_int_t n, | | void mincgcreatef(ae_int_t n, | |
| /* Real */ ae_vector* x, | | /* Real */ ae_vector* x, | |
| double diffstep, | | double diffstep, | |
| mincgstate* state, | | mincgstate* state, | |
| ae_state *_state); | | ae_state *_state); | |
| void mincgsetcond(mincgstate* state, | | void mincgsetcond(mincgstate* state, | |
| | | | |
| skipping to change at line 3212 | | skipping to change at line 3531 | |
| ae_state *_state); | | ae_state *_state); | |
| void mincgsetpreclowrankfast(mincgstate* state, | | void mincgsetpreclowrankfast(mincgstate* state, | |
| /* Real */ ae_vector* d1, | | /* Real */ ae_vector* d1, | |
| /* Real */ ae_vector* c, | | /* Real */ ae_vector* c, | |
| /* Real */ ae_matrix* v, | | /* Real */ ae_matrix* v, | |
| ae_int_t vcnt, | | ae_int_t vcnt, | |
| ae_state *_state); | | ae_state *_state); | |
| void mincgsetprecvarpart(mincgstate* state, | | void mincgsetprecvarpart(mincgstate* state, | |
| /* Real */ ae_vector* d2, | | /* Real */ ae_vector* d2, | |
| ae_state *_state); | | ae_state *_state); | |
|
| | | void mincgsetgradientcheck(mincgstate* state, | |
| | | double teststep, | |
| | | ae_state *_state); | |
| ae_bool _mincgstate_init(mincgstate* p, ae_state *_state, ae_bool make_auto
matic); | | ae_bool _mincgstate_init(mincgstate* p, ae_state *_state, ae_bool make_auto
matic); | |
| ae_bool _mincgstate_init_copy(mincgstate* dst, mincgstate* src, ae_state *_
state, ae_bool make_automatic); | | ae_bool _mincgstate_init_copy(mincgstate* dst, mincgstate* src, ae_state *_
state, ae_bool make_automatic); | |
| void _mincgstate_clear(mincgstate* p); | | void _mincgstate_clear(mincgstate* p); | |
| ae_bool _mincgreport_init(mincgreport* p, ae_state *_state, ae_bool make_au
tomatic); | | ae_bool _mincgreport_init(mincgreport* p, ae_state *_state, ae_bool make_au
tomatic); | |
| ae_bool _mincgreport_init_copy(mincgreport* dst, mincgreport* src, ae_state
*_state, ae_bool make_automatic); | | ae_bool _mincgreport_init_copy(mincgreport* dst, mincgreport* src, ae_state
*_state, ae_bool make_automatic); | |
| void _mincgreport_clear(mincgreport* p); | | void _mincgreport_clear(mincgreport* p); | |
| void minbleiccreate(ae_int_t n, | | void minbleiccreate(ae_int_t n, | |
| /* Real */ ae_vector* x, | | /* Real */ ae_vector* x, | |
| minbleicstate* state, | | minbleicstate* state, | |
| ae_state *_state); | | ae_state *_state); | |
| | | | |
| skipping to change at line 3274 | | skipping to change at line 3596 | |
| /* Real */ ae_vector* x, | | /* Real */ ae_vector* x, | |
| minbleicreport* rep, | | minbleicreport* rep, | |
| ae_state *_state); | | ae_state *_state); | |
| void minbleicresultsbuf(minbleicstate* state, | | void minbleicresultsbuf(minbleicstate* state, | |
| /* Real */ ae_vector* x, | | /* Real */ ae_vector* x, | |
| minbleicreport* rep, | | minbleicreport* rep, | |
| ae_state *_state); | | ae_state *_state); | |
| void minbleicrestartfrom(minbleicstate* state, | | void minbleicrestartfrom(minbleicstate* state, | |
| /* Real */ ae_vector* x, | | /* Real */ ae_vector* x, | |
| ae_state *_state); | | ae_state *_state); | |
|
| | | void minbleicsetgradientcheck(minbleicstate* state, | |
| | | double teststep, | |
| | | ae_state *_state); | |
| ae_bool _minbleicstate_init(minbleicstate* p, ae_state *_state, ae_bool mak
e_automatic); | | ae_bool _minbleicstate_init(minbleicstate* p, ae_state *_state, ae_bool mak
e_automatic); | |
| ae_bool _minbleicstate_init_copy(minbleicstate* dst, minbleicstate* src, ae
_state *_state, ae_bool make_automatic); | | ae_bool _minbleicstate_init_copy(minbleicstate* dst, minbleicstate* src, ae
_state *_state, ae_bool make_automatic); | |
| void _minbleicstate_clear(minbleicstate* p); | | void _minbleicstate_clear(minbleicstate* p); | |
| ae_bool _minbleicreport_init(minbleicreport* p, ae_state *_state, ae_bool m
ake_automatic); | | ae_bool _minbleicreport_init(minbleicreport* p, ae_state *_state, ae_bool m
ake_automatic); | |
| ae_bool _minbleicreport_init_copy(minbleicreport* dst, minbleicreport* src,
ae_state *_state, ae_bool make_automatic); | | ae_bool _minbleicreport_init_copy(minbleicreport* dst, minbleicreport* src,
ae_state *_state, ae_bool make_automatic); | |
| void _minbleicreport_clear(minbleicreport* p); | | void _minbleicreport_clear(minbleicreport* p); | |
| void minlbfgscreate(ae_int_t n, | | void minlbfgscreate(ae_int_t n, | |
| ae_int_t m, | | ae_int_t m, | |
| /* Real */ ae_vector* x, | | /* Real */ ae_vector* x, | |
| minlbfgsstate* state, | | minlbfgsstate* state, | |
| | | | |
| skipping to change at line 3334 | | skipping to change at line 3659 | |
| /* Real */ ae_vector* x, | | /* Real */ ae_vector* x, | |
| minlbfgsreport* rep, | | minlbfgsreport* rep, | |
| ae_state *_state); | | ae_state *_state); | |
| void minlbfgsresultsbuf(minlbfgsstate* state, | | void minlbfgsresultsbuf(minlbfgsstate* state, | |
| /* Real */ ae_vector* x, | | /* Real */ ae_vector* x, | |
| minlbfgsreport* rep, | | minlbfgsreport* rep, | |
| ae_state *_state); | | ae_state *_state); | |
| void minlbfgsrestartfrom(minlbfgsstate* state, | | void minlbfgsrestartfrom(minlbfgsstate* state, | |
| /* Real */ ae_vector* x, | | /* Real */ ae_vector* x, | |
| ae_state *_state); | | ae_state *_state); | |
|
| | | void minlbfgssetgradientcheck(minlbfgsstate* state, | |
| | | double teststep, | |
| | | ae_state *_state); | |
| ae_bool _minlbfgsstate_init(minlbfgsstate* p, ae_state *_state, ae_bool mak
e_automatic); | | ae_bool _minlbfgsstate_init(minlbfgsstate* p, ae_state *_state, ae_bool mak
e_automatic); | |
| ae_bool _minlbfgsstate_init_copy(minlbfgsstate* dst, minlbfgsstate* src, ae
_state *_state, ae_bool make_automatic); | | ae_bool _minlbfgsstate_init_copy(minlbfgsstate* dst, minlbfgsstate* src, ae
_state *_state, ae_bool make_automatic); | |
| void _minlbfgsstate_clear(minlbfgsstate* p); | | void _minlbfgsstate_clear(minlbfgsstate* p); | |
| ae_bool _minlbfgsreport_init(minlbfgsreport* p, ae_state *_state, ae_bool m
ake_automatic); | | ae_bool _minlbfgsreport_init(minlbfgsreport* p, ae_state *_state, ae_bool m
ake_automatic); | |
| ae_bool _minlbfgsreport_init_copy(minlbfgsreport* dst, minlbfgsreport* src,
ae_state *_state, ae_bool make_automatic); | | ae_bool _minlbfgsreport_init_copy(minlbfgsreport* dst, minlbfgsreport* src,
ae_state *_state, ae_bool make_automatic); | |
| void _minlbfgsreport_clear(minlbfgsreport* p); | | void _minlbfgsreport_clear(minlbfgsreport* p); | |
|
| | | void cqminit(ae_int_t n, convexquadraticmodel* s, ae_state *_state); | |
| | | void cqmseta(convexquadraticmodel* s, | |
| | | /* Real */ ae_matrix* a, | |
| | | ae_bool isupper, | |
| | | double alpha, | |
| | | ae_state *_state); | |
| | | void cqmrewritedensediagonal(convexquadraticmodel* s, | |
| | | /* Real */ ae_vector* z, | |
| | | ae_state *_state); | |
| | | void cqmsetd(convexquadraticmodel* s, | |
| | | /* Real */ ae_vector* d, | |
| | | double tau, | |
| | | ae_state *_state); | |
| | | void cqmdropa(convexquadraticmodel* s, ae_state *_state); | |
| | | void cqmsetb(convexquadraticmodel* s, | |
| | | /* Real */ ae_vector* b, | |
| | | ae_state *_state); | |
| | | void cqmsetq(convexquadraticmodel* s, | |
| | | /* Real */ ae_matrix* q, | |
| | | /* Real */ ae_vector* r, | |
| | | ae_int_t k, | |
| | | double theta, | |
| | | ae_state *_state); | |
| | | void cqmsetactiveset(convexquadraticmodel* s, | |
| | | /* Real */ ae_vector* x, | |
| | | /* Boolean */ ae_vector* activeset, | |
| | | ae_state *_state); | |
| | | double cqmeval(convexquadraticmodel* s, | |
| | | /* Real */ ae_vector* x, | |
| | | ae_state *_state); | |
| | | void cqmevalx(convexquadraticmodel* s, | |
| | | /* Real */ ae_vector* x, | |
| | | double* r, | |
| | | double* noise, | |
| | | ae_state *_state); | |
| | | void cqmgradunconstrained(convexquadraticmodel* s, | |
| | | /* Real */ ae_vector* x, | |
| | | /* Real */ ae_vector* g, | |
| | | ae_state *_state); | |
| | | double cqmxtadx2(convexquadraticmodel* s, | |
| | | /* Real */ ae_vector* x, | |
| | | ae_state *_state); | |
| | | void cqmadx(convexquadraticmodel* s, | |
| | | /* Real */ ae_vector* x, | |
| | | /* Real */ ae_vector* y, | |
| | | ae_state *_state); | |
| | | ae_bool cqmconstrainedoptimum(convexquadraticmodel* s, | |
| | | /* Real */ ae_vector* x, | |
| | | ae_state *_state); | |
| | | void cqmscalevector(convexquadraticmodel* s, | |
| | | /* Real */ ae_vector* x, | |
| | | ae_state *_state); | |
| | | double cqmdebugconstrainedevalt(convexquadraticmodel* s, | |
| | | /* Real */ ae_vector* x, | |
| | | ae_state *_state); | |
| | | double cqmdebugconstrainedevale(convexquadraticmodel* s, | |
| | | /* Real */ ae_vector* x, | |
| | | ae_state *_state); | |
| | | ae_bool _convexquadraticmodel_init(convexquadraticmodel* p, ae_state *_stat | |
| | | e, ae_bool make_automatic); | |
| | | ae_bool _convexquadraticmodel_init_copy(convexquadraticmodel* dst, convexqu | |
| | | adraticmodel* src, ae_state *_state, ae_bool make_automatic); | |
| | | void _convexquadraticmodel_clear(convexquadraticmodel* p); | |
| void minqpcreate(ae_int_t n, minqpstate* state, ae_state *_state); | | void minqpcreate(ae_int_t n, minqpstate* state, ae_state *_state); | |
| void minqpsetlinearterm(minqpstate* state, | | void minqpsetlinearterm(minqpstate* state, | |
| /* Real */ ae_vector* b, | | /* Real */ ae_vector* b, | |
| ae_state *_state); | | ae_state *_state); | |
| void minqpsetquadraticterm(minqpstate* state, | | void minqpsetquadraticterm(minqpstate* state, | |
| /* Real */ ae_matrix* a, | | /* Real */ ae_matrix* a, | |
| ae_bool isupper, | | ae_bool isupper, | |
| ae_state *_state); | | ae_state *_state); | |
| void minqpsetstartingpoint(minqpstate* state, | | void minqpsetstartingpoint(minqpstate* state, | |
| /* Real */ ae_vector* x, | | /* Real */ ae_vector* x, | |
| ae_state *_state); | | ae_state *_state); | |
| void minqpsetorigin(minqpstate* state, | | void minqpsetorigin(minqpstate* state, | |
| /* Real */ ae_vector* xorigin, | | /* Real */ ae_vector* xorigin, | |
| ae_state *_state); | | ae_state *_state); | |
| void minqpsetalgocholesky(minqpstate* state, ae_state *_state); | | void minqpsetalgocholesky(minqpstate* state, ae_state *_state); | |
| void minqpsetbc(minqpstate* state, | | void minqpsetbc(minqpstate* state, | |
| /* Real */ ae_vector* bndl, | | /* Real */ ae_vector* bndl, | |
| /* Real */ ae_vector* bndu, | | /* Real */ ae_vector* bndu, | |
| ae_state *_state); | | ae_state *_state); | |
|
| | | void minqpsetlc(minqpstate* state, | |
| | | /* Real */ ae_matrix* c, | |
| | | /* Integer */ ae_vector* ct, | |
| | | ae_int_t k, | |
| | | ae_state *_state); | |
| void minqpoptimize(minqpstate* state, ae_state *_state); | | void minqpoptimize(minqpstate* state, ae_state *_state); | |
| void minqpresults(minqpstate* state, | | void minqpresults(minqpstate* state, | |
| /* Real */ ae_vector* x, | | /* Real */ ae_vector* x, | |
| minqpreport* rep, | | minqpreport* rep, | |
| ae_state *_state); | | ae_state *_state); | |
| void minqpresultsbuf(minqpstate* state, | | void minqpresultsbuf(minqpstate* state, | |
| /* Real */ ae_vector* x, | | /* Real */ ae_vector* x, | |
| minqpreport* rep, | | minqpreport* rep, | |
| ae_state *_state); | | ae_state *_state); | |
| void minqpsetlineartermfast(minqpstate* state, | | void minqpsetlineartermfast(minqpstate* state, | |
| | | | |
| skipping to change at line 3451 | | skipping to change at line 3845 | |
| void minlmcreatefgj(ae_int_t n, | | void minlmcreatefgj(ae_int_t n, | |
| ae_int_t m, | | ae_int_t m, | |
| /* Real */ ae_vector* x, | | /* Real */ ae_vector* x, | |
| minlmstate* state, | | minlmstate* state, | |
| ae_state *_state); | | ae_state *_state); | |
| void minlmcreatefj(ae_int_t n, | | void minlmcreatefj(ae_int_t n, | |
| ae_int_t m, | | ae_int_t m, | |
| /* Real */ ae_vector* x, | | /* Real */ ae_vector* x, | |
| minlmstate* state, | | minlmstate* state, | |
| ae_state *_state); | | ae_state *_state); | |
|
| | | void minlmsetgradientcheck(minlmstate* state, | |
| | | double teststep, | |
| | | ae_state *_state); | |
| ae_bool _minlmstate_init(minlmstate* p, ae_state *_state, ae_bool make_auto
matic); | | ae_bool _minlmstate_init(minlmstate* p, ae_state *_state, ae_bool make_auto
matic); | |
| ae_bool _minlmstate_init_copy(minlmstate* dst, minlmstate* src, ae_state *_
state, ae_bool make_automatic); | | ae_bool _minlmstate_init_copy(minlmstate* dst, minlmstate* src, ae_state *_
state, ae_bool make_automatic); | |
| void _minlmstate_clear(minlmstate* p); | | void _minlmstate_clear(minlmstate* p); | |
| ae_bool _minlmreport_init(minlmreport* p, ae_state *_state, ae_bool make_au
tomatic); | | ae_bool _minlmreport_init(minlmreport* p, ae_state *_state, ae_bool make_au
tomatic); | |
| ae_bool _minlmreport_init_copy(minlmreport* dst, minlmreport* src, ae_state
*_state, ae_bool make_automatic); | | ae_bool _minlmreport_init_copy(minlmreport* dst, minlmreport* src, ae_state
*_state, ae_bool make_automatic); | |
| void _minlmreport_clear(minlmreport* p); | | void _minlmreport_clear(minlmreport* p); | |
| void minlbfgssetdefaultpreconditioner(minlbfgsstate* state, | | void minlbfgssetdefaultpreconditioner(minlbfgsstate* state, | |
| ae_state *_state); | | ae_state *_state); | |
| void minlbfgssetcholeskypreconditioner(minlbfgsstate* state, | | void minlbfgssetcholeskypreconditioner(minlbfgsstate* state, | |
| /* Real */ ae_matrix* p, | | /* Real */ ae_matrix* p, | |
| | | | |
End of changes. 41 change blocks. |
| 18 lines changed or deleted | | 427 lines changed or added | |
|