When using the AugmentedLagrangian solver, with a NonlinearObjectiveFunction, and a number of NonlinearConstraints in a List, if one or more of the constraints is constructed using the NonlinearConstraint(IObjectiveFunction objective, Expression<Func<double[], bool>> constraint) constructor, a NullReferenceException is thrown.
This is because the Gradient function of the constraint is null upon construction.
I see why this happens, but why is there not a constructor that looks like NonlinearConstraint(IObjectiveFunction objective, Expression<Func<double[], bool>> function, Func<double[], double[]> gradient) that allows the gradient to be defined along with the objective function and constraint function, rather than having to use the less clear public NonlinearConstraint(IObjectiveFunction objective, Func<double[], double> function, Func<double[], double[]> gradient) signature which specifies only the left hand side of the equation?