Skip to content
This repository has been archived by the owner on Nov 19, 2020. It is now read-only.

AugmentedLagrangian with NonlinearConstraints - Gradient NullReferenceException issue #177

Closed
jamesbascle opened this issue Dec 18, 2015 · 1 comment

Comments

@jamesbascle
Copy link

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?

@cesarsouza
Copy link
Member

Integrated in release 3.4.0.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants