Free cookie consent management tool by TermsFeed Policy Generator

Changeset 15354


Ignore:
Timestamp:
09/07/17 17:09:54 (7 years ago)
Author:
mkommend
Message:

#1666: Changed delegate creation in constant optimization.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/SimplifierViewsProgress/HeuristicLab.Problems.DataAnalysis.Symbolic.Regression/3.4/SingleObjective/Evaluators/SymbolicRegressionConstantOptimizationEvaluator.cs

    r15353 r15354  
    210210      alglib.ndimensional_pfunc function_cx_1_func = CreatePFunc(func);
    211211      alglib.ndimensional_pgrad function_cx_1_grad = CreatePGrad(func_grad);
    212       alglib.ndimensional_rep xrep = null;
    213       if (iterationCallback != null)
    214         xrep = new alglib.ndimensional_rep(iterationCallback);
     212      alglib.ndimensional_rep xrep = (p, f, obj) => iterationCallback(p, f, obj);
    215213
    216214      try {
     
    221219        alglib.lsfitfit(state, function_cx_1_func, function_cx_1_grad, xrep, null);
    222220        alglib.lsfitresults(state, out retVal, out c, out rep);
    223       } catch (ArithmeticException) {
     221      }
     222      catch (ArithmeticException) {
    224223        return originalQuality;
    225       } catch (alglib.alglibexception) {
     224      }
     225      catch (alglib.alglibexception) {
    226226        return originalQuality;
    227227      }
Note: See TracChangeset for help on using the changeset viewer.