Moreover, we activate a method to restore infeasibility, if any, with respect to the inequality constraints in the problem formulation. We set the maximum number of iterations to five in the feasibility recovery method. The default number of iterations is three. Each iteration requires a constraint and constraint gradient evaluation.
#include <iostream> #include <fstream> #include "NLF.h" #include "OptNIPS.h" #include "hockfcns.h" using NEWMAT::ColumnVector; using namespace OPTPP; void update_model(int, int, ColumnVector) {} int main () { int n = 3; static char *status_file = {"tsthock65.out"}; // Create a Constrained Nonlinear problem object NLF2 nips(n,hs65,init_hs65,create_constraint_hs65); // Build a finite-difference NIPS object and optimize OptNIPS objfcn(&nips, update_model); objfcn.setOutputFile(status_file, 0); objfcn.setFcnTol(1.0e-06); objfcn.setMaxIter(150); objfcn.setSearchStrategy(LineSearch); objfcn.setMaxBacktrackIter(7); objfcn.setMeritFcn(NormFmu); objfcn.setFeasibilityRecovery(true); objfcn.setMaxFeasIter(5); objfcn.optimize(); objfcn.printStatus("Solution from nips"); objfcn.cleanup(); }
Next Section: NPSOL wrapper | Back to Solvers Page
Last revised September 14, 2006 .