stevengj / nlopt

library for nonlinear optimization, wrapping many algorithms for global and local, constrained or unconstrained, optimization
Other
1.88k stars 584 forks source link

How to use nlopt sovling nonlinear problem which only have object grad information #393

Closed maxwangatgit closed 3 years ago

maxwangatgit commented 3 years ago

Recently , i am trying to convert some code from matlab to c and fmincon in matlab is very important part in my project. In the project fmincon is called with options "gradObj on" which means only object grad is used. But in nlopt project, it seems like the object grad and nonl constraints grad must use at the same time. How can I fix this problem?

stevengj commented 3 years ago

NLopt doesn't currently have any algorithms that use the objective gradient but not the constraint gradients — it uses only both or neither.