File: myconstraint.m

package info (click to toggle)
nlopt 2.7.1-7.1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,940 kB
  • sloc: ansic: 24,572; cpp: 2,983; sh: 86; makefile: 55; f90: 53; lisp: 37; python: 27
file content (6 lines) | stat: -rw-r--r-- 158 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
function [val, gradient] = myconstraint(x,a,b)
    val = (a*x(1) + b)^3 - x(2);
    if (nargout > 1)
        gradient = [3*a*(a*x(1) + b)^2, -1];
    end
end