Changeset 17004


Ignore:
Timestamp:
06/11/19 20:58:17 (2 weeks ago)
Author:
gkronber
Message:

#2994: use "non-smooth" optimizer instead of "nlc" optimizer from alglib

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2994-AutoDiffForIntervals/HeuristicLab.Problems.DataAnalysis.Regression.Symbolic.Extensions/ConstrainedConstantOptimizationEvaluator.cs

    r16941 r17004  
    325325
    326326
    327       alglib.minnlcstate state;
    328       alglib.minnlcreport rep;
     327      alglib.minnsstate state;
     328      alglib.minnsreport rep;
    329329      try {
    330         alglib.minnlccreate(thetaValues.Count, thetaValues.ToArray(), out state);
    331         alglib.minnlcsetalgoslp(state);        // SLP is more robust but slower
    332         alglib.minnlcsetbc(state, thetaValues.Select(_ => -10000.0).ToArray(), thetaValues.Select(_ => +10000.0).ToArray());
    333         alglib.minnlcsetcond(state, 1E-7, maxIterations);
     330        alglib.minnscreate(thetaValues.Count, thetaValues.ToArray(), out state);
     331        // alglib.minnssetalgoslp(state);        // SLP is more robust but slower
     332        alglib.minnssetbc(state, thetaValues.Select(_ => -10000.0).ToArray(), thetaValues.Select(_ => +10000.0).ToArray());
     333        alglib.minnssetcond(state, 1E-7, maxIterations);
    334334        var s = Enumerable.Repeat(1d, thetaValues.Count).ToArray();  // scale is set to unit scale
    335         alglib.minnlcsetscale(state, s);
     335        alglib.minnssetscale(state, s);
    336336
    337337        // set non-linear constraints: 0 equality constraints, constraintTrees inequality constraints
    338         alglib.minnlcsetnlc(state, 0, constraintTrees.Count);
    339 
    340         alglib.minnlcoptimize(state, calculate_jacobian, null, null);
    341         alglib.minnlcresults(state, out double[] xOpt, out rep);
     338        alglib.minnssetnlc(state, 0, constraintTrees.Count);
     339
     340        alglib.minnsoptimize(state, calculate_jacobian, null, null);
     341        alglib.minnsresults(state, out double[] xOpt, out rep);
    342342
    343343
Note: See TracChangeset for help on using the changeset viewer.