public void Run() { var method = new UnconstrainedMixedMinimizer(); method.Minimizer = new HookeJeevesMinimizer(); method.AddImplicitConstraint(new Constraint(x => x[1] - x[0], d => d >= 0)); method.AddImplicitConstraint(new Constraint(x => 2 - x[0], d => d >= 0)); method.Minimize(new F1(), new double[] { -1.9, 2.0 }); method.Minimize(new F2(), new double[] { 0.1, 0.3 }); }
public void Run() { var method = new UnconstrainedMixedMinimizer(); method.Minimizer = new NelderMeadMinimizer(); method.AddImplicitConstraint(new Constraint(x => 3 - x[0] - x[1], d => d >= 0)); method.AddImplicitConstraint(new Constraint(x => 3 + 1.5 * x[0] - x[1], d => d >= 0)); method.AddImplicitConstraint(new Constraint(x => x[1] - 1, d => d == 0, true)); method.Minimize(new F5(3, 0), new[] { 0.0, 0.0 }); method.Minimize(new F5(3, 0), new[] { 6.0, 7.0 }); }