⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 alternativefunctions.html.svn-base

📁 OPT++
💻 SVN-BASE
字号:
/** \page AlternativeFunctions Alternate Forms of Nonlinear Objects \section problem Problem SetupThere are alternate forms of the function that accept a <em>vptr</em> as the final argument.  A <em> vptr</em> is a void pointer that the user can use for any desired purpose, such as application reentry. The most common constructors are shown below.<ul>  <li> NLF0(ndim, fcn, init_fcn, constraint, <b>vptr</b>): problem has no analytic  derivative information available  <BR>  <li> NLF1(ndim, fcn, init_fcn, constraint, <b>vptr</b>): problem has analytic  first derivatives available, but no analytic second derivatives  <BR>  <li> NLF2(ndim, fcn, init_fcn, constraint,<b>vptr</b>):  problem has analytic first and       second derivatives available  <BR>  <li> FDNLF1(ndim, fcn, init_fcn, constraint, <b>vptr</b>): problem has no  analytic derivative information available, but finite differences  are used to approximate first derivatives  <BR>  <li> LSQNLF(ndim, lsqterms, lsqfcn, init_fcn, constraint,<b>vptr</b>): problem has a  least squares operator, Gauss-Newton is used to approximate Jacobian  and Hessian</ul>For completeness, we describe the other arguments to the constructor.The arguments to the constructors must be defined before instantiatingthe function object. The following description holds for the first four nonlinear function objects, which have identical argument lists. We willdefine the argument list for the LSQNLF later.The first argument, <em>ndim</em>, is an integerspecifying the dimension of the problem.  The second argument,<em>fcn</em>, is a pointer to the subroutine that evaluates thefunction.  The form of this pointer/subroutine is described in moredetail in the <a href="#functions"> User-Defined Functions</a>subsection.  The third argument, <em>init_fcn</em>, is a pointer tothe subroutine that initializes the function.  Again, the form of thispointer/subroutine is described in the <a href="#functions">User-Defined Functions</a> subsection.  The fourth argument,<em>constraint</em>, is a pointer to a constraint object.  If theoptimization problem of interest has no constraints, this argument canbe excluded.  Otherwise, it can be constructed as described in the<a href="SetUp#constraints"> %Constraint Setup</a> subsection. For the LSQNLF object, the first argument, <em>ndim</em>, is an integerspecifying the dimension of the problem.  The second argument, <em>lsqterms</em>, is an integer specifying the number of least square termsin the function. The third argument,<em>lsqfcn</em>, is a pointer to the subroutine that evaluates the least squaresoperator.  The form of this pointer/subroutine is described in moredetail in the <a href="#functions"> User-Defined Functions</a>subsection.  The remaining arguments have the same meaning as previouslydefined. <a name="functions"><em> User-Defined Functions </em></a>In addition to the main routine, the user must provide additional C++code that performs the initialization of the problem, the evaluationof the objective function, and the evaluation of any nonlinearconstraints.  This code must also include the computation of anyanalytic derivative information that is to be provided.  Thesesubroutines may appear in the same file as the main routine or in aseparate file, and they must satisfy the interfaces listed below.The function interfaces are the following:<ul>      <li> void (*USERFCN0V)(ndim, x, fx, result, vptr):  for NLF0 and FDNLF1      <li> void (*USERFCN1V)(mode, ndim, x, fx, gx, result, vptr):  for NLF1      <li> void (*USERFCN2V)(mode, ndim, x, fx, gx, Hx, result, vptr):  for NFL2      <li> void (*USERFCNLSQ0V)(ndim, x, lsfx, result, vptr):  for LSQNLF or      <li> void (*USERFCNLSQ1V)(mode, ndim, x, lsfx, lsgx, result, vptr):  for LSQNLF</ul>The arguments of these functions are fairly straightforward.<em>ndim</em> is an integer that specifies the dimension of theproblem, <em>x</em> is a ColumnVector that contains the values of theoptimization variables, <em>fx</em> is the value of the objectivefunction at <em>x</em>, <em>gx</em> is a ColumnVector containing thegradient of the objective function at <em>x</em>, <em>Hx</em> is aSymmetricMatrix containing the Hessian of the objective function at<em>x</em>, <em>mode</em> is an integer encoding of the type ofevaluation requested (i.e., function, gradient, Hessian), <em>result</em> is an integer encoding of the type of evaluationsavailable and <em>vptr</em> is a void pointer which contains user-specifiedinformation.  For the least squares operator, <em>lsfx</em> is a ColumnVectorwith each entry containing the value of one of the least squares terms and <em>lsgx</em> is a Matrix containing the Jacobian of the least squares operator at <em>x</em>.The ColumnVector, Matrix, and SymmetricMatrix objects are describedin the <a href="http://robertnz.net/nm11.htm"> NEWMAT documentation</a>.  <p> Previous Section:  \ref SetUp | Next Section:  \ref GUI_XMLDoc| Back to the <a href="index.html"> Main Page</a> </p>Last revised <em> April 18, 2007</em>*/

⌨️ 快捷键说明

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