OPT++ - An Object-Oriented Nonlinear Optimization Library - 7
OPT++ - An Object-Oriented Nonlinear Optimization Library - 7
Unconstrained minimization
In this section, we present the constructors for an objective function, supply a prototype function evaluator, and provide examples for solving
the unconstrained minimization problem.
minimize
Representing the Rosenbrock problem as an NLF1 requires an user-supplied function to evaluate the problem and construction of an NLF1.
Step 1: Write a function that evaluates the Rosenbrock problem and gradient.
if (n != 2) return;
x1 = x(1);
x2 = x(2);
f1 = (x2 - x1 * x1);
f2 = 1. - x1;
NLF1 rosen_problem(n,rosen,init_rosen);
Bug Reports OPT++ Developers Copyright Information GNU Lesser General Public License
Documentation, generated by , last revised August 30, 2006.
https://software.sandia.gov/opt++/opt++2.4_doc/html/UnconstrainedProblems.html 2/2