tstqnewton.html.svn-base

来自「OPT++」· SVN-BASE 代码 · 共 64 行

SVN-BASE
64
字号
/** \page tstqnewton Quasi-Newton Method with trust-region We solve the Rosenbrock problem using a Quasi-Newton method withBFGS update for the Hessian.  The implemented trust-region method is the dogleg method.  Other valid globalization strategies are line-search and trust region parallel direct search method.  An iteration history is written to file \a tstqnewton.out.\code   //   // Test program for Quasi-Newton optimization objects   //   #include <fstream>   #include "OptQNewton.h"   #include "NLF.h"   #include "tstfcn.h"   using NEWMAT::ColumnVector;   using namespace OPTPP;   void update_model(int, int, ColumnVector) {}   int main ()   {     int n = 2;       static char *status_file = {"tstqnewton.out"};     //  Create a Nonlinear problem object     NLF1 nlp(n,rosen,init_rosen);       nlp.setIsExpensive(true);     //  Create a "Tolerances" object and set the tolerances     TOLS tol;              tol.setDefaultTol();     tol.setFTol(1.e-9);    // Set convergence tolerance to 1.e-9      tol.setMaxIter(200);   // Set maximum number of outer iterations to 200       //  Build a Quasi-Newton object and optimize      OptQNewton objfcn(&nlp,tol);        if (!objfcn.setOutputFile(status_file, 0))       cerr << "main: output file open failed" << endl;     objfcn.setTRSize(100.); // Set initial trust region radius to 100     objfcn.optimize();     objfcn.printStatus("Solution from quasi-newton");     objfcn.cleanup();	    }\endcode<p> <a href="BoundConstrainedProblems.html"> Next Section: Bound-constrained	minimization</a> |  <a href="Classification.html">		        Back to Solvers Page</a> </p> Last revised <em> September 14, 2006 </em>.*/

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?