Une MAJ de sécurité est nécessaire sur notre version actuelle. Elle sera effectuée lundi 02/08 entre 12h30 et 13h. L'interruption de service devrait durer quelques minutes (probablement moins de 5 minutes).

Commit 008a06a4 by Laurent Belcour

### Better working non-linear solver.

parent cb99c1eb
 ... ... @@ -111,7 +111,7 @@ class altaNLP : public Ipopt::TNLP vec _y = _di - (*_f)(_x); for(int i=0; i<_f->dimY(); ++i) { obj_value += abs(_y[i]); obj_value += pow(_y[i], 2); } } ... ... @@ -143,7 +143,7 @@ class altaNLP : public Ipopt::TNLP // Compute the difference vector and add its // components to the obj_value vec _y = _di - (*_f)(_x); vec _y = (*_f)(_x) - _di; // Get the jacobian of the function at position x_i for the current // set of parameters (set prior to function call) ... ... @@ -156,14 +156,7 @@ class altaNLP : public Ipopt::TNLP // vector row for(int i=0; i<_f->dimY(); ++i) { if(_y[i] > 0.0) { grad_f[j] += -_jac[i*_f->nbParameters() + j]; } else { grad_f[j] += _jac[i*_f->nbParameters() + j]; } grad_f[j] += 2 * _y[i] * _jac[i*_f->nbParameters() + j]; } } } ... ...
 ... ... @@ -59,14 +59,14 @@ void df(double* fjac, const nonlinear_function* f, const data* d) // Should add the resulting vector completely vec _y = (*f)(xi) - _di; // For each output channel, update the subpart of the // vector row for(int i=0; idimY(); ++i) // Fill the columns of the matrix for(int j=0; jnbParameters(); ++j) { // Fill the columns of the matrix for(int j=0; jnbParameters(); ++j) // For each output channel, update the subpart of the // vector row for(int i=0; idimY(); ++i) { fjac[j] = 2 * _y[i] * _jac[i*f->nbParameters() + j]; fjac[j] += 2 * _y[i] * _jac[i*f->nbParameters() + j]; } } } ... ... @@ -176,6 +176,14 @@ bool nonlinear_fitter_nlopt::fit_data(const data* d, function* fit, const argume { algorithm = NLOPT_LN_SBPLX; } else if(optimizerName == "controlled-random-search") { algorithm = NLOPT_GN_CRS2_LM; } else if(optimizerName == "SQP") { algorithm = NLOPT_LD_SLSQP; } else { // The default option one can find in the NLOpt documentation ... ...
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!