<?xml version='1.0'?>
<html xmlns='http://www.w3.org/1999/xhtml'
      xmlns:math='http://www.w3.org/1998/Math/MathML'
>
<head>
<title>Nonlinear Programming Using the CppAD Interface to Ipopt</title>
<meta name="description" id="description" content="Nonlinear Programming Using the CppAD Interface to Ipopt"/>
<meta name="keywords" id="keywords" content=" nonlinear programming Cppad deprecated ipopt interface Ipopt Ad "/>
<style type='text/css'>
body { color : black }
body { background-color : white }
A:link { color : blue }
A:visited { color : purple }
A:active { color : purple }
</style>
<script type='text/javascript' language='JavaScript' src='_cppad_ipopt_nlp_xml.js'>
</script>
</head>
<body>
<table><tr>
<td>
<a href="http://www.coin-or.org/CppAD/" target="_top"><img border="0" src="_image.gif"/></a>
</td>
<td><a href="test_vector.xml" target="_top">Prev</a>
</td><td><a href="ipopt_nlp_get_started.cpp.xml" target="_top">Next</a>
</td><td>
<select onchange='choose_across0(this)'>
<option>Index-&gt;</option>
<option>contents</option>
<option>reference</option>
<option>index</option>
<option>search</option>
<option>external</option>
</select>
</td>
<td>
<select onchange='choose_up0(this)'>
<option>Up-&gt;</option>
<option>CppAD</option>
<option>Appendix</option>
<option>deprecated</option>
<option>cppad_ipopt_nlp</option>
</select>
</td>
<td>
<select onchange='choose_down3(this)'>
<option>CppAD-&gt;</option>
<option>Install</option>
<option>Introduction</option>
<option>AD</option>
<option>ADFun</option>
<option>preprocessor</option>
<option>multi_thread</option>
<option>library</option>
<option>ipopt_solve</option>
<option>Example</option>
<option>speed</option>
<option>Appendix</option>
</select>
</td>
<td>
<select onchange='choose_down2(this)'>
<option>Appendix-&gt;</option>
<option>Faq</option>
<option>Theory</option>
<option>glossary</option>
<option>Bib</option>
<option>Bugs</option>
<option>WishList</option>
<option>whats_new</option>
<option>deprecated</option>
<option>compare_c</option>
<option>License</option>
</select>
</td>
<td>
<select onchange='choose_down1(this)'>
<option>deprecated-&gt;</option>
<option>include_deprecated</option>
<option>FunDeprecated</option>
<option>omp_max_thread</option>
<option>TrackNewDel</option>
<option>omp_alloc</option>
<option>memory_leak</option>
<option>epsilon</option>
<option>test_vector</option>
<option>cppad_ipopt_nlp</option>
<option>old_atomic</option>
</select>
</td>
<td>
<select onchange='choose_down0(this)'>
<option>cppad_ipopt_nlp-&gt;</option>
<option>ipopt_nlp_get_started.cpp</option>
<option>ipopt_nlp_ode</option>
<option>ipopt_ode_speed.cpp</option>
</select>
</td>
<td>
<select onchange='choose_current0(this)'>
<option>Headings-&gt;</option>
<option>Deprecated</option>
<option>Syntax</option>
<option>Purpose</option>
<option>cppad_ipopt namespace</option>
<option>ipopt_library_paths</option>
<option>fg(x)</option>
<option>---..Index Vector</option>
<option>---..Projection</option>
<option>---..Injection</option>
<option>---..Representation</option>
<option>Simple Representation</option>
<option>SizeVector</option>
<option>NumberVector</option>
<option>ADNumber</option>
<option>ADVector</option>
<option>n</option>
<option>m</option>
<option>x_i</option>
<option>x_l</option>
<option>x_u</option>
<option>g_l</option>
<option>g_u</option>
<option>fg_info</option>
<option>---..fg_info.number_functions</option>
<option>---..fg_info.eval_r</option>
<option>---..fg_info.retape</option>
<option>---..fg_info.domain_size</option>
<option>---..fg_info.range_size</option>
<option>---..fg_info.number_terms</option>
<option>---..fg_info.index</option>
<option>solution</option>
<option>---..status</option>
<option>---..x</option>
<option>---..z_l</option>
<option>---..z_u</option>
<option>---..g</option>
<option>---..lambda</option>
<option>---..obj_value</option>
<option>Example</option>
<option>Wish List</option>
</select>
</td>
</tr></table><br/>



<center><b><big><big>Nonlinear Programming Using the CppAD Interface to Ipopt</big></big></b></center>
<br/>
<b><big><a name="Deprecated" id="Deprecated">Deprecated</a></big></b>
<br/>
This interface to Ipopt is deprecated, use <a href="ipopt_solve.xml" target="_top"><span style='white-space: nowrap'>ipopt_solve</span></a>
 instead.

<br/>
<br/>
<b><big><a name="Syntax" id="Syntax">Syntax</a></big></b>

<br/>

<code><font color="blue"><span style='white-space: nowrap'>#&#xA0;include&#xA0;&quot;cppad_ipopt_nlp.hpp&quot;<br/>
</span></font></code>

<code><font color="blue"><span style='white-space: nowrap'>cppad_ipopt_solution&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>solution</span></font></i><font color="blue"><span style='white-space: nowrap'>;<br/>
</span></font></code>

<code><font color="blue"><span style='white-space: nowrap'>cppad_ipopt_nlp&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>cppad_nlp</span></font></i><font color="blue"><span style='white-space: nowrap'>(<br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>n</span></font></i><font color="blue"><span style='white-space: nowrap'>,&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>m</span></font></i><font color="blue"><span style='white-space: nowrap'>,&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>x_i</span></font></i><font color="blue"><span style='white-space: nowrap'>,&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>x_l</span></font></i><font color="blue"><span style='white-space: nowrap'>,&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>x_u</span></font></i><font color="blue"><span style='white-space: nowrap'>,&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>g_l</span></font></i><font color="blue"><span style='white-space: nowrap'>,&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>g_u</span></font></i><font color="blue"><span style='white-space: nowrap'>,&#xA0;&amp;</span></font><i><font color="black"><span style='white-space: nowrap'>fg_info</span></font></i><font color="blue"><span style='white-space: nowrap'>,&#xA0;&amp;</span></font><i><font color="black"><span style='white-space: nowrap'>solution</span></font></i><font color="blue"><span style='white-space: nowrap'><br/>
)</span></font></code>


<code><font color="blue"><span style='white-space: nowrap'><br/>
export&#xA0;LD_LIBRARY_PATH=$LD_LIBRARY_PATH:</span></font><i><font color="black"><span style='white-space: nowrap'>ipopt_library_paths</span></font></i></code>


<br/>
<br/>
<b><big><a name="Purpose" id="Purpose">Purpose</a></big></b>
<br/>
The class <code><font color="blue">cppad_ipopt_nlp</font></code> is used to solve nonlinear programming
problems of the form

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mrow>
<mtable rowalign="center" ><mtr><mtd columnalign="right" >
<mrow><mstyle mathvariant='normal'><mi mathvariant='normal'>minimize</mi>
</mstyle></mrow>
</mtd><mtd columnalign="left" >
<mi mathvariant='italic'>f</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>x</mi>
<mo stretchy="false">)</mo>
</mtd></mtr><mtr><mtd columnalign="right" >
<mrow><mstyle mathvariant='normal'><mi mathvariant='normal'>subject</mi>
<mspace width='.3em'/>
<mi mathvariant='normal'>to</mi>
</mstyle></mrow>
</mtd><mtd columnalign="left" >
<msup><mi mathvariant='italic'>g</mi>
<mi mathvariant='italic'>l</mi>
</msup>
<mo stretchy="false">&#x02264;</mo>
<mi mathvariant='italic'>g</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>x</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">&#x02264;</mo>
<msup><mi mathvariant='italic'>g</mi>
<mi mathvariant='italic'>u</mi>
</msup>
</mtd></mtr><mtr><mtd columnalign="right" >
</mtd><mtd columnalign="left" >
<msup><mi mathvariant='italic'>x</mi>
<mi mathvariant='italic'>l</mi>
</msup>
<mo stretchy="false">&#x02264;</mo>
<mi mathvariant='italic'>x</mi>
<mo stretchy="false">&#x02264;</mo>
<msup><mi mathvariant='italic'>x</mi>
<mi mathvariant='italic'>u</mi>
</msup>
</mtd></mtr></mtable>
</mrow></math>

This is done using 
<a href="http://www.coin-or.org/projects/Ipopt.xml" target="_top"><span style='white-space: nowrap'>Ipopt</span></a>

optimizer and 
<a href="http://www.coin-or.org/CppAD/" target="_top"><span style='white-space: nowrap'>CppAD</span></a>

Algorithmic Differentiation package.

<br/>
<br/>
<b><big><a name="cppad_ipopt namespace" id="cppad_ipopt namespace">cppad_ipopt namespace</a></big></b>
<br/>
All of the declarations for these routines
are in the <code><font color="blue">cppad_ipopt</font></code> namespace 
(not the <code><font color="blue">CppAD</font></code> namespace).
For example; <a href="cppad_ipopt_nlp.xml#SizeVector" target="_top"><span style='white-space: nowrap'>SizeVector</span></a>
 below
actually denotes the type <code><font color="blue">cppad_ipopt::SizeVector</font></code>.

<br/>
<br/>
<b><big><a name="ipopt_library_paths" id="ipopt_library_paths">ipopt_library_paths</a></big></b>
<br/>
If you are linking to a shared version of the Ipopt library,
you may have to add some paths the <code><font color="blue">LD_LIBRARY_PATH</font></code> 
shell variable using the <code><font color="blue">export</font></code> command in the syntax above.
For example, if the file the ipopt library is

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>ipopt_prefix</span></font></i><font color="blue"><span style='white-space: nowrap'>/lib64/libipopt.a<br/>
</span></font></code>
you will need to add the corresponding directory; e.g.,

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;export&#xA0;LD_LIBRARY_PATH=&quot;</span></font><i><font color="black"><span style='white-space: nowrap'>ipopt_prefix</span></font></i><font color="blue"><span style='white-space: nowrap'>/lib64</span></font><i><font color="black"><span style='white-space: nowrap'>:$LD_LIBRARY_PATH&quot;<br/>
</span></font></i></code>
see <a href="ipopt_prefix.xml" target="_top"><span style='white-space: nowrap'>ipopt_prefix</span></a>
.

<br/>
<br/>
<b><big><a name="fg(x)" id="fg(x)">fg(x)</a></big></b>
<br/>
The function 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>fg</mi>
<mo stretchy="false">:</mo>
<msup><mrow><mstyle mathvariant='bold'><mi mathvariant='bold'>R</mi>
</mstyle></mrow>
<mi mathvariant='italic'>n</mi>
</msup>
<mo stretchy="false">&#x02192;</mo>
<msup><mrow><mstyle mathvariant='bold'><mi mathvariant='bold'>R</mi>
</mstyle></mrow>
<mrow><mi mathvariant='italic'>m</mi>
<mo stretchy="false">+</mo>
<mn>1</mn>
</mrow>
</msup>
</mrow></math>

 is defined by

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mrow>
<mtable rowalign="center" ><mtr><mtd columnalign="right" >
<msub><mi mathvariant='italic'>fg</mi>
<mn>0</mn>
</msub>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>x</mi>
<mo stretchy="false">)</mo>
</mtd><mtd columnalign="center" >
<mo stretchy="false">=</mo>
</mtd><mtd columnalign="left" >
<mi mathvariant='italic'>f</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>x</mi>
<mo stretchy="false">)</mo>
</mtd></mtr><mtr><mtd columnalign="right" >
<msub><mi mathvariant='italic'>fg</mi>
<mn>1</mn>
</msub>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>x</mi>
<mo stretchy="false">)</mo>
</mtd><mtd columnalign="center" >
<mo stretchy="false">=</mo>
</mtd><mtd columnalign="left" >
<msub><mi mathvariant='italic'>g</mi>
<mn>0</mn>
</msub>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>x</mi>
<mo stretchy="false">)</mo>
</mtd></mtr><mtr><mtd columnalign="right" >
</mtd><mtd columnalign="center" >
<mo stretchy="false">&#x022EE;</mo>
</mtd><mtd columnalign="left" >
</mtd></mtr><mtr><mtd columnalign="right" >
<msub><mi mathvariant='italic'>fg</mi>
<mi mathvariant='italic'>m</mi>
</msub>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>x</mi>
<mo stretchy="false">)</mo>
</mtd><mtd columnalign="center" >
<mo stretchy="false">=</mo>
</mtd><mtd columnalign="left" >
<msub><mi mathvariant='italic'>g</mi>
<mrow><mi mathvariant='italic'>m</mi>
<mn>-1</mn>
</mrow>
</msub>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>x</mi>
<mo stretchy="false">)</mo>
</mtd></mtr></mtable>
</mrow></math>

<br/>
<b><a name="fg(x).Index Vector" id="fg(x).Index Vector">Index Vector</a></b>
<br/>
We define an 
<code><i><font color="black"><span style='white-space: nowrap'>index&#xA0;vector</span></font></i></code>
 as a vector of non-negative integers
for which none of the values are equal; i.e.,
it is both a vector and a set.
If 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>I</mi>
</mrow></math>

 is an index vector 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mo stretchy="false">|</mo>
<mi mathvariant='italic'>I</mi>
<mo stretchy="false">|</mo>
</mrow></math>

 is used to denote the
number of elements in 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>I</mi>
</mrow></math>

 and 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mo stretchy="false">&#x02016;</mo>
<mi mathvariant='italic'>I</mi>
<mo stretchy="false">&#x02016;</mo>
</mrow></math>

 is used
to denote the value of the maximum element in 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>I</mi>
</mrow></math>

.

<br/>
<br/>
<b><a name="fg(x).Projection" id="fg(x).Projection">Projection</a></b>
<br/>
Given an index vector 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>J</mi>
</mrow></math>

 and a positive integer 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>n</mi>
</mrow></math>


where 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>n</mi>
<mo stretchy="false">&gt;</mo>
<mo stretchy="false">&#x02016;</mo>
<mi mathvariant='italic'>J</mi>
<mo stretchy="false">&#x02016;</mo>
</mrow></math>

, we use 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>J</mi>
<mo stretchy="false">&#x02297;</mo>
<mi mathvariant='italic'>n</mi>
</mrow></math>

 for
the mapping 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>J</mi>
<mo stretchy="false">&#x02297;</mo>
<mi mathvariant='italic'>n</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">:</mo>
<msup><mrow><mstyle mathvariant='bold'><mi mathvariant='bold'>R</mi>
</mstyle></mrow>
<mi mathvariant='italic'>n</mi>
</msup>
<mo stretchy="false">&#x02192;</mo>
<msup><mrow><mstyle mathvariant='bold'><mi mathvariant='bold'>R</mi>
</mstyle></mrow>
<mrow><mo stretchy="false">|</mo>
<mi mathvariant='italic'>J</mi>
<mo stretchy="false">|</mo>
</mrow>
</msup>
</mrow></math>

 defined by

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mrow>
<mo stretchy="false">[</mo>
<mi mathvariant='italic'>J</mi>
<mo stretchy="false">&#x02297;</mo>
<mi mathvariant='italic'>n</mi>
<mo stretchy="false">]</mo>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>x</mi>
<msub><mo stretchy="false">)</mo>
<mi mathvariant='italic'>j</mi>
</msub>
<mo stretchy="false">=</mo>
<msub><mi mathvariant='italic'>x</mi>
<mrow><mi mathvariant='italic'>J</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>j</mi>
<mo stretchy="false">)</mo>
</mrow>
</msub>
</mrow></math>

for 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>j</mi>
<mo stretchy="false">=</mo>
<mn>0</mn>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02026;</mo>
<mo stretchy="false">|</mo>
<mi mathvariant='italic'>J</mi>
<mo stretchy="false">|</mo>
<mo stretchy="false">-</mo>
<mn>1</mn>
</mrow></math>

.

<br/>
<br/>
<b><a name="fg(x).Injection" id="fg(x).Injection">Injection</a></b>
<br/>
Given an index vector 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>I</mi>
</mrow></math>

 and a positive integer 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>m</mi>
</mrow></math>


where 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>m</mi>
<mo stretchy="false">&gt;</mo>
<mo stretchy="false">&#x02016;</mo>
<mi mathvariant='italic'>I</mi>
<mo stretchy="false">&#x02016;</mo>
</mrow></math>

, we use 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>m</mi>
<mo stretchy="false">&#x02297;</mo>
<mi mathvariant='italic'>I</mi>
</mrow></math>

 for
the mapping 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>m</mi>
<mo stretchy="false">&#x02297;</mo>
<mi mathvariant='italic'>I</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">:</mo>
<msup><mrow><mstyle mathvariant='bold'><mi mathvariant='bold'>R</mi>
</mstyle></mrow>
<mrow><mo stretchy="false">|</mo>
<mi mathvariant='italic'>I</mi>
<mo stretchy="false">|</mo>
</mrow>
</msup>
<mo stretchy="false">&#x02192;</mo>
<msup><mrow><mstyle mathvariant='bold'><mi mathvariant='bold'>R</mi>
</mstyle></mrow>
<mi mathvariant='italic'>m</mi>
</msup>
</mrow></math>

 defined by

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mrow>
<mo stretchy="false">[</mo>
<mi mathvariant='italic'>m</mi>
<mo stretchy="false">&#x02297;</mo>
<mi mathvariant='italic'>I</mi>
<mo stretchy="false">]</mo>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>y</mi>
<msub><mo stretchy="false">)</mo>
<mi mathvariant='italic'>i</mi>
</msub>
<mo stretchy="false">=</mo>
<mrow><mo stretchy="true">{</mo><mrow><mtable rowalign="center" ><mtr><mtd columnalign="left" >
<msub><mi mathvariant='italic'>y</mi>
<mi mathvariant='italic'>k</mi>
</msub>
</mtd><mtd columnalign="left" >
<mrow><mstyle mathvariant='normal'><mi mathvariant='normal'>if</mi>
</mstyle></mrow>
<mspace width='.3em'/>
<mi mathvariant='italic'>i</mi>
<mo stretchy="false">=</mo>
<mi mathvariant='italic'>I</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">)</mo>
<mspace width='.3em'/>
<mrow><mstyle mathvariant='normal'><mi mathvariant='normal'>for</mi>
<mspace width='.3em'/>
<mi mathvariant='normal'>some</mi>
</mstyle></mrow>
<mspace width='.3em'/>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">&#x02208;</mo>
<mo stretchy="false">{</mo>
<mn>0</mn>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x022EF;</mo>
<mo stretchy="false">,</mo>
<mo stretchy="false">|</mo>
<mi mathvariant='italic'>I</mi>
<mo stretchy="false">|</mo>
<mn>-1</mn>
<mo stretchy="false">}</mo>
</mtd></mtr><mtr><mtd columnalign="left" >
<mn>0</mn>
</mtd><mtd columnalign="left" >
<mrow><mstyle mathvariant='normal'><mi mathvariant='normal'>otherwise</mi>
</mstyle></mrow>
</mtd></mtr></mtable>
</mrow><mo stretchy="true"> </mo></mrow>
</mrow></math>

<br/>
<b><a name="fg(x).Representation" id="fg(x).Representation">Representation</a></b>
<br/>
In many applications, each of the component functions of 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>fg</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>x</mi>
<mo stretchy="false">)</mo>
</mrow></math>


only depend on a few of the components of 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>x</mi>
</mrow></math>

.
In this case, expressing 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>fg</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>x</mi>
<mo stretchy="false">)</mo>
</mrow></math>

 in terms of simpler functions
with fewer arguments can greatly reduce the amount of work required
to compute its derivatives.
<code><span style='white-space: nowrap'><br/>
<br/>
</span></code>We use the functions

<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<msub><mi mathvariant='italic'>r</mi>
<mi mathvariant='italic'>k</mi>
</msub>
<mo stretchy="false">:</mo>
<msup><mrow><mstyle mathvariant='bold'><mi mathvariant='bold'>R</mi>
</mstyle></mrow>
<mrow><mi mathvariant='italic'>q</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">)</mo>
</mrow>
</msup>
<mo stretchy="false">&#x02192;</mo>
<msup><mrow><mstyle mathvariant='bold'><mi mathvariant='bold'>R</mi>
</mstyle></mrow>
<mrow><mi mathvariant='italic'>p</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">)</mo>
</mrow>
</msup>
</mrow></math>

 
for 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">=</mo>
<mn>0</mn>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02026;</mo>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>K</mi>
</mrow></math>

 to express our
representation of 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>fg</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>x</mi>
<mo stretchy="false">)</mo>
</mrow></math>

 in terms of simpler functions
as follows

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mrow>
<mi mathvariant='italic'>fg</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>x</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">=</mo>
<munderover><mo displaystyle='true' largeop='true'>&#x02211;</mo>
<mrow><mi mathvariant='italic'>k</mi>
<mo stretchy="false">=</mo>
<mn>0</mn>
</mrow>
<mrow><mi mathvariant='italic'>K</mi>
<mn>-1</mn>
</mrow>
</munderover>
<mspace width='.3em'/>
<munderover><mo displaystyle='true' largeop='true'>&#x02211;</mo>
<mrow><mo stretchy="false">&#x02113;</mo>
<mo stretchy="false">=</mo>
<mn>0</mn>
</mrow>
<mrow><mi mathvariant='italic'>L</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">-</mo>
<mn>1</mn>
</mrow>
</munderover>
<mo stretchy="false">[</mo>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>m</mi>
<mo stretchy="false">+</mo>
<mn>1</mn>
<mo stretchy="false">)</mo>
<mo stretchy="false">&#x02297;</mo>
<msub><mi mathvariant='italic'>I</mi>
<mrow><mi mathvariant='italic'>k</mi>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02113;</mo>
</mrow>
</msub>
<mo stretchy="false">]</mo>
<mspace width='.3em'/>
<mo stretchy="false">&#x02218;</mo>
<mspace width='.3em'/>
<msub><mi mathvariant='italic'>r</mi>
<mi mathvariant='italic'>k</mi>
</msub>
<mspace width='.3em'/>
<mo stretchy="false">&#x02218;</mo>
<mspace width='.3em'/>
<mo stretchy="false">[</mo>
<msub><mi mathvariant='italic'>J</mi>
<mrow><mi mathvariant='italic'>k</mi>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02113;</mo>
</mrow>
</msub>
<mo stretchy="false">&#x02297;</mo>
<mi mathvariant='italic'>n</mi>
<mo stretchy="false">]</mo>
<mspace width='.3em'/>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>x</mi>
<mo stretchy="false">)</mo>
</mrow></math>

where 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mo stretchy="false">&#x02218;</mo>
</mrow></math>

 represents function composition,
for 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">=</mo>
<mn>0</mn>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02026;</mo>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>K</mi>
<mo stretchy="false">-</mo>
<mn>1</mn>
</mrow></math>

, and 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mo stretchy="false">&#x02113;</mo>
<mo stretchy="false">=</mo>
<mn>0</mn>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02026;</mo>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>L</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">)</mo>
</mrow></math>

,

<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<msub><mi mathvariant='italic'>I</mi>
<mrow><mi mathvariant='italic'>k</mi>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02113;</mo>
</mrow>
</msub>
</mrow></math>

 and  
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<msub><mi mathvariant='italic'>J</mi>
<mrow><mi mathvariant='italic'>k</mi>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02113;</mo>
</mrow>
</msub>
</mrow></math>

 are index vectors with

<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mo stretchy="false">|</mo>
<msub><mi mathvariant='italic'>J</mi>
<mrow><mi mathvariant='italic'>k</mi>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02113;</mo>
</mrow>
</msub>
<mo stretchy="false">|</mo>
<mo stretchy="false">=</mo>
<mi mathvariant='italic'>q</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">)</mo>
</mrow></math>

, 

<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mo stretchy="false">&#x02016;</mo>
<msub><mi mathvariant='italic'>J</mi>
<mrow><mi mathvariant='italic'>k</mi>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02113;</mo>
</mrow>
</msub>
<mo stretchy="false">&#x02016;</mo>
<mo stretchy="false">&lt;</mo>
<mi mathvariant='italic'>n</mi>
</mrow></math>

,

<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mo stretchy="false">|</mo>
<msub><mi mathvariant='italic'>I</mi>
<mrow><mi mathvariant='italic'>k</mi>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02113;</mo>
</mrow>
</msub>
<mo stretchy="false">|</mo>
<mo stretchy="false">=</mo>
<mi mathvariant='italic'>p</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">)</mo>
</mrow></math>

, and

<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mo stretchy="false">&#x02016;</mo>
<msub><mi mathvariant='italic'>I</mi>
<mrow><mi mathvariant='italic'>k</mi>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02113;</mo>
</mrow>
</msub>
<mo stretchy="false">&#x02016;</mo>
<mo stretchy="false">&#x02264;</mo>
<mi mathvariant='italic'>m</mi>
</mrow></math>

. 

<br/>
<br/>
<b><big><a name="Simple Representation" id="Simple Representation">Simple Representation</a></big></b>
<br/>
In the simple representation,

<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<msub><mi mathvariant='italic'>r</mi>
<mn>0</mn>
</msub>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>x</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">=</mo>
<mi mathvariant='italic'>fg</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>x</mi>
<mo stretchy="false">)</mo>
</mrow></math>

,

<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>K</mi>
<mo stretchy="false">=</mo>
<mn>1</mn>
</mrow></math>

,

<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>q</mi>
<mo stretchy="false">(</mo>
<mn>0</mn>
<mo stretchy="false">)</mo>
<mo stretchy="false">=</mo>
<mi mathvariant='italic'>n</mi>
</mrow></math>

,

<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>p</mi>
<mo stretchy="false">(</mo>
<mn>0</mn>
<mo stretchy="false">)</mo>
<mo stretchy="false">=</mo>
<mi mathvariant='italic'>m</mi>
<mo stretchy="false">+</mo>
<mn>1</mn>
</mrow></math>

,

<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>L</mi>
<mo stretchy="false">(</mo>
<mn>0</mn>
<mo stretchy="false">)</mo>
<mo stretchy="false">=</mo>
<mn>1</mn>
</mrow></math>

,

<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<msub><mi mathvariant='italic'>I</mi>
<mrow><mn>0</mn>
<mo stretchy="false">,</mo>
<mn>0</mn>
</mrow>
</msub>
<mo stretchy="false">=</mo>
<mo stretchy="false">(</mo>
<mn>0</mn>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02026;</mo>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>m</mi>
<mo stretchy="false">)</mo>
</mrow></math>

,
and 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<msub><mi mathvariant='italic'>J</mi>
<mrow><mn>0</mn>
<mo stretchy="false">,</mo>
<mn>0</mn>
</mrow>
</msub>
<mo stretchy="false">=</mo>
<mo stretchy="false">(</mo>
<mn>0</mn>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02026;</mo>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>n</mi>
<mn>-1</mn>
<mo stretchy="false">)</mo>
</mrow></math>

.

<br/>
<br/>
<b><big><a name="SizeVector" id="SizeVector">SizeVector</a></big></b>
<br/>
The type 
<code><font color="blue"><span style='white-space: nowrap'>SizeVector</span></font></code>
 is defined by the 

<code><font color="blue"><span style='white-space: nowrap'>cppad_ipopt_nlp.hpp</span></font></code>
 include file to be a 
<a href="simplevector.xml" target="_top"><span style='white-space: nowrap'>SimpleVector</span></a>
 class with elements of type
<code><font color="blue">size_t</font></code>.

<br/>
<br/>
<b><big><a name="NumberVector" id="NumberVector">NumberVector</a></big></b>
<br/>
The type 
<code><font color="blue"><span style='white-space: nowrap'>NumberVector</span></font></code>
 is defined by the 

<code><font color="blue"><span style='white-space: nowrap'>cppad_ipopt_nlp.hpp</span></font></code>
 include file to be a 
<a href="simplevector.xml" target="_top"><span style='white-space: nowrap'>SimpleVector</span></a>
 class with elements of type
<code><font color="blue">Ipopt::Number</font></code>.

<br/>
<br/>
<b><big><a name="ADNumber" id="ADNumber">ADNumber</a></big></b>
<br/>
The type 
<code><font color="blue"><span style='white-space: nowrap'>ADNumber</span></font></code>
 is defined by the 

<code><font color="blue"><span style='white-space: nowrap'>cppad_ipopt_nlp.hpp</span></font></code>
 include file to be a 
an AD type that can be used to compute derivatives.

<br/>
<br/>
<b><big><a name="ADVector" id="ADVector">ADVector</a></big></b>
<br/>
The type 
<code><font color="blue"><span style='white-space: nowrap'>ADVector</span></font></code>
 is defined by the 

<code><font color="blue"><span style='white-space: nowrap'>cppad_ipopt_nlp.hpp</span></font></code>
 include file to be a 
<a href="simplevector.xml" target="_top"><span style='white-space: nowrap'>SimpleVector</span></a>
 class with elements of type
<code><font color="blue">ADNumber</font></code>. 

<br/>
<br/>
<b><big><a name="n" id="n">n</a></big></b>
<br/>
The argument 
<code><i><font color="black"><span style='white-space: nowrap'>n</span></font></i></code>
 has prototype

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;size_t&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>n</span></font></i><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>
It specifies the dimension of the argument space; 
i.e., 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>x</mi>
<mo stretchy="false">&#x02208;</mo>
<msup><mrow><mstyle mathvariant='bold'><mi mathvariant='bold'>R</mi>
</mstyle></mrow>
<mi mathvariant='italic'>n</mi>
</msup>
</mrow></math>

.

<br/>
<br/>
<b><big><a name="m" id="m">m</a></big></b>
<br/>
The argument 
<code><i><font color="black"><span style='white-space: nowrap'>m</span></font></i></code>
 has prototype

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;size_t&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>m</span></font></i><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>
It specifies the dimension of the range space for 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>g</mi>
</mrow></math>

; 
i.e., 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>g</mi>
<mo stretchy="false">:</mo>
<msup><mrow><mstyle mathvariant='bold'><mi mathvariant='bold'>R</mi>
</mstyle></mrow>
<mi mathvariant='italic'>n</mi>
</msup>
<mo stretchy="false">&#x02192;</mo>
<msup><mrow><mstyle mathvariant='bold'><mi mathvariant='bold'>R</mi>
</mstyle></mrow>
<mi mathvariant='italic'>m</mi>
</msup>
</mrow></math>

.

<br/>
<br/>
<b><big><a name="x_i" id="x_i">x_i</a></big></b>
<br/>
The argument 
<code><i><font color="black"><span style='white-space: nowrap'>x_i</span></font></i></code>
 has prototype

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;const&#xA0;NumberVector&amp;&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>x_i</span></font></i><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>
and its size is equal to 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>n</mi>
</mrow></math>

.
It specifies the initial point where Ipopt starts the optimization process.

<br/>
<br/>
<b><big><a name="x_l" id="x_l">x_l</a></big></b>
<br/>
The argument 
<code><i><font color="black"><span style='white-space: nowrap'>x_l</span></font></i></code>
 has prototype

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;const&#xA0;NumberVector&amp;&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>x_l</span></font></i><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>
and its size is equal to 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>n</mi>
</mrow></math>

.
It specifies the lower limits for the argument in the optimization problem;
i.e., 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<msup><mi mathvariant='italic'>x</mi>
<mi mathvariant='italic'>l</mi>
</msup>
</mrow></math>

.

<br/>
<br/>
<b><big><a name="x_u" id="x_u">x_u</a></big></b>
<br/>
The argument 
<code><i><font color="black"><span style='white-space: nowrap'>x_u</span></font></i></code>
 has prototype

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;const&#xA0;NumberVector&amp;&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>x_u</span></font></i><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>
and its size is equal to 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>n</mi>
</mrow></math>

.
It specifies the upper limits for the argument in the optimization problem;
i.e., 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<msup><mi mathvariant='italic'>x</mi>
<mi mathvariant='italic'>u</mi>
</msup>
</mrow></math>

.

<br/>
<br/>
<b><big><a name="g_l" id="g_l">g_l</a></big></b>
<br/>
The argument 
<code><i><font color="black"><span style='white-space: nowrap'>g_l</span></font></i></code>
 has prototype

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;const&#xA0;NumberVector&amp;&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>g_l</span></font></i><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>
and its size is equal to 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>m</mi>
</mrow></math>

.
It specifies the lower limits for the constraints in the optimization problem;
i.e., 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<msup><mi mathvariant='italic'>g</mi>
<mi mathvariant='italic'>l</mi>
</msup>
</mrow></math>

.

<br/>
<br/>
<b><big><a name="g_u" id="g_u">g_u</a></big></b>
<br/>
The argument 
<code><i><font color="black"><span style='white-space: nowrap'>g_u</span></font></i></code>
 has prototype

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;const&#xA0;NumberVector&amp;&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>g_u</span></font></i><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>
and its size is equal to 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>n</mi>
</mrow></math>

.
It specifies the upper limits for the constraints in the optimization problem;
i.e., 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<msup><mi mathvariant='italic'>g</mi>
<mi mathvariant='italic'>u</mi>
</msup>
</mrow></math>

.

<br/>
<br/>
<b><big><a name="fg_info" id="fg_info">fg_info</a></big></b>
<br/>
The argument 
<code><i><font color="black"><span style='white-space: nowrap'>fg_info</span></font></i></code>
 has prototype

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>FG_info&#xA0;fg_info</span></font></i><font color="blue"><span style='white-space: nowrap'><br/>
</span></font></code>
where the class 
<code><i><font color="black"><span style='white-space: nowrap'>FG_info</span></font></i></code>
 is derived from the 
base class <code><font color="blue">cppad_ipopt_fg_info</font></code>.
Certain virtual member functions of 
<code><i><font color="black"><span style='white-space: nowrap'>fg_info</span></font></i></code>
 are used to 
compute the value of 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>fg</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>x</mi>
<mo stretchy="false">)</mo>
</mrow></math>

.
The specifications for these member functions are given below:

<br/>
<br/>
<b><a name="fg_info.fg_info.number_functions" id="fg_info.fg_info.number_functions">fg_info.number_functions</a></b>
<br/>
This member function has prototype

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;virtual&#xA0;size_t&#xA0;cppad_ipopt_fg_info::number_functions(void)<br/>
</span></font></code>
If 
<code><i><font color="black"><span style='white-space: nowrap'>K</span></font></i></code>
 has type <code><font color="blue">size_t</font></code>, the syntax

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>K</span></font></i><font color="blue"><span style='white-space: nowrap'>&#xA0;=&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>fg_info</span></font></i><font color="blue"><span style='white-space: nowrap'>.number_functions()<br/>
</span></font></code>
sets 
<code><i><font color="black"><span style='white-space: nowrap'>K</span></font></i></code>
 to the number of functions used in the
representation of 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>fg</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>x</mi>
<mo stretchy="false">)</mo>
</mrow></math>

; i.e., 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>K</mi>
</mrow></math>

 in
the <a href="cppad_ipopt_nlp.xml#fg(x).Representation" target="_top"><span style='white-space: nowrap'>representation</span></a>
 above.
<code><span style='white-space: nowrap'><br/>
<br/>
</span></code>The <code><font color="blue">cppad_ipopt_fg_info</font></code> implementation of this function
corresponds to the simple representation mentioned above; i.e.

<code><i><font color="black"><span style='white-space: nowrap'>K</span></font></i><font color="blue"><span style='white-space: nowrap'>&#xA0;=&#xA0;1</span></font></code>
.

<br/>
<br/>
<b><a name="fg_info.fg_info.eval_r" id="fg_info.fg_info.eval_r">fg_info.eval_r</a></b>
<br/>
This member function has the prototype

<code><font color="blue"><span style='white-space: nowrap'><br/>
virtual&#xA0;ADVector&#xA0;cppad_ipopt_fg_info::eval_r(size_t&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>k</span></font></i><font color="blue"><span style='white-space: nowrap'>,&#xA0;const&#xA0;ADVector&amp;&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>u</span></font></i><font color="blue"><span style='white-space: nowrap'>)&#xA0;=&#xA0;0;<br/>
</span></font></code>
Thus it is a pure virtual function and must be defined in the 
derived class 
<code><i><font color="black"><span style='white-space: nowrap'>FG_info</span></font></i></code>
.
<code><span style='white-space: nowrap'><br/>
<br/>
</span></code>This function computes the value of 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<msub><mi mathvariant='italic'>r</mi>
<mi mathvariant='italic'>k</mi>
</msub>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>u</mi>
<mo stretchy="false">)</mo>
</mrow></math>


used in the <a href="cppad_ipopt_nlp.xml#fg(x).Representation" target="_top"><span style='white-space: nowrap'>representation</span></a>

for 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>fg</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>x</mi>
<mo stretchy="false">)</mo>
</mrow></math>

.
If 
<code><i><font color="black"><span style='white-space: nowrap'>k</span></font></i></code>
 in 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mo stretchy="false">{</mo>
<mn>0</mn>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02026;</mo>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>K</mi>
<mn>-1</mn>
<mo stretchy="false">}</mo>
</mrow></math>

 has type <code><font color="blue">size_t</font></code>,

<code><i><font color="black"><span style='white-space: nowrap'>u</span></font></i></code>
 is an <code><font color="blue">ADVector</font></code> of size 
<code><i><font color="black"><span style='white-space: nowrap'>q(k)</span></font></i></code>
 
and 
<code><i><font color="black"><span style='white-space: nowrap'>r</span></font></i></code>
 is an <code><font color="blue">ADVector</font></code> of size 
<code><i><font color="black"><span style='white-space: nowrap'>p(k)</span></font></i></code>

the syntax

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>r</span></font></i><font color="blue"><span style='white-space: nowrap'>&#xA0;=&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>fg_info</span></font></i><font color="blue"><span style='white-space: nowrap'>.eval_r(</span></font><i><font color="black"><span style='white-space: nowrap'>k</span></font></i><font color="blue"><span style='white-space: nowrap'>,&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>u</span></font></i><font color="blue"><span style='white-space: nowrap'>)<br/>
</span></font></code>
set 
<code><i><font color="black"><span style='white-space: nowrap'>r</span></font></i></code>
 to the vector 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<msub><mi mathvariant='italic'>r</mi>
<mi mathvariant='italic'>k</mi>
</msub>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>u</mi>
<mo stretchy="false">)</mo>
</mrow></math>

.

<br/>
<br/>
<b><a name="fg_info.fg_info.retape" id="fg_info.fg_info.retape">fg_info.retape</a></b>
<br/>
This member function has the prototype

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;virtual&#xA0;bool&#xA0;cppad_ipopt_fg_info::retape(size_t&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>k</span></font></i><font color="blue"><span style='white-space: nowrap'>)<br/>
</span></font></code>
If 
<code><i><font color="black"><span style='white-space: nowrap'>k</span></font></i></code>
 in 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mo stretchy="false">{</mo>
<mn>0</mn>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02026;</mo>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>K</mi>
<mn>-1</mn>
<mo stretchy="false">}</mo>
</mrow></math>

 has type <code><font color="blue">size_t</font></code>,
and 
<code><i><font color="black"><span style='white-space: nowrap'>retape</span></font></i></code>
 has type <code><font color="blue">bool</font></code>,
the syntax

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>retape</span></font></i><font color="blue"><span style='white-space: nowrap'>&#xA0;=&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>fg_info</span></font></i><font color="blue"><span style='white-space: nowrap'>.retape(</span></font><i><font color="black"><span style='white-space: nowrap'>k</span></font></i><font color="blue"><span style='white-space: nowrap'>)<br/>
</span></font></code>
sets 
<code><i><font color="black"><span style='white-space: nowrap'>retape</span></font></i></code>
 to true or false.
If 
<code><i><font color="black"><span style='white-space: nowrap'>retape</span></font></i></code>
 is true, 
<code><font color="blue">cppad_ipopt_nlp</font></code> will retape the operation sequence 
corresponding to 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<msub><mi mathvariant='italic'>r</mi>
<mi mathvariant='italic'>k</mi>
</msub>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>u</mi>
<mo stretchy="false">)</mo>
</mrow></math>

 for
every value of 
<code><i><font color="black"><span style='white-space: nowrap'>u</span></font></i></code>
. 
An <code><font color="blue">cppad_ipopt_nlp</font></code> object
should use much less memory and run faster if 
<code><i><font color="black"><span style='white-space: nowrap'>retape</span></font></i></code>
 is false.
You can test both the true and false cases to make sure 
the operation sequence does not depend on 
<code><i><font color="black"><span style='white-space: nowrap'>u</span></font></i></code>
.
<code><span style='white-space: nowrap'><br/>
<br/>
</span></code>The <code><font color="blue">cppad_ipopt_fg_info</font></code> implementation of this function
sets 
<code><i><font color="black"><span style='white-space: nowrap'>retape</span></font></i></code>
 to true 
(while slower it is also safer to always retape).

<br/>
<br/>
<b><a name="fg_info.fg_info.domain_size" id="fg_info.fg_info.domain_size">fg_info.domain_size</a></b>
<br/>
This member function has prototype

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;virtual&#xA0;size_t&#xA0;cppad_ipopt_fg_info::domain_size(size_t&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>k</span></font></i><font color="blue"><span style='white-space: nowrap'>)<br/>
</span></font></code>
If 
<code><i><font color="black"><span style='white-space: nowrap'>k</span></font></i></code>
 in 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mo stretchy="false">{</mo>
<mn>0</mn>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02026;</mo>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>K</mi>
<mn>-1</mn>
<mo stretchy="false">}</mo>
</mrow></math>

 has type <code><font color="blue">size_t</font></code>,
and 
<code><i><font color="black"><span style='white-space: nowrap'>q</span></font></i></code>
 has type <code><font color="blue">size_t</font></code>, the syntax

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>q</span></font></i><font color="blue"><span style='white-space: nowrap'>&#xA0;=&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>fg_info</span></font></i><font color="blue"><span style='white-space: nowrap'>.domain_size(</span></font><i><font color="black"><span style='white-space: nowrap'>k</span></font></i><font color="blue"><span style='white-space: nowrap'>)<br/>
</span></font></code>
sets 
<code><i><font color="black"><span style='white-space: nowrap'>q</span></font></i></code>
 to the dimension of the domain space for 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<msub><mi mathvariant='italic'>r</mi>
<mi mathvariant='italic'>k</mi>
</msub>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>u</mi>
<mo stretchy="false">)</mo>
</mrow></math>

;
i.e., 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>q</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">)</mo>
</mrow></math>

 in
the <a href="cppad_ipopt_nlp.xml#fg(x).Representation" target="_top"><span style='white-space: nowrap'>representation</span></a>
 above.

<code><span style='white-space: nowrap'><br/>
<br/>
</span></code>The <code><font color="blue">cppad_ipopt_h_base</font></code> implementation of this function
corresponds to the simple representation mentioned above; i.e.,

<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>q</mi>
<mo stretchy="false">=</mo>
<mi mathvariant='italic'>n</mi>
</mrow></math>

.

<br/>
<br/>
<b><a name="fg_info.fg_info.range_size" id="fg_info.fg_info.range_size">fg_info.range_size</a></b>
<br/>
This member function has prototype

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;virtual&#xA0;size_t&#xA0;cppad_ipopt_fg_info::range_size(size_t&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>k</span></font></i><font color="blue"><span style='white-space: nowrap'>)<br/>
</span></font></code>
If 
<code><i><font color="black"><span style='white-space: nowrap'>k</span></font></i></code>
 in 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mo stretchy="false">{</mo>
<mn>0</mn>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02026;</mo>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>K</mi>
<mn>-1</mn>
<mo stretchy="false">}</mo>
</mrow></math>

 has type <code><font color="blue">size_t</font></code>,
and 
<code><i><font color="black"><span style='white-space: nowrap'>p</span></font></i></code>
 has type <code><font color="blue">size_t</font></code>, the syntax

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>p</span></font></i><font color="blue"><span style='white-space: nowrap'>&#xA0;=&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>fg_info</span></font></i><font color="blue"><span style='white-space: nowrap'>.range_size(</span></font><i><font color="black"><span style='white-space: nowrap'>k</span></font></i><font color="blue"><span style='white-space: nowrap'>)<br/>
</span></font></code>
sets 
<code><i><font color="black"><span style='white-space: nowrap'>p</span></font></i></code>
 to the dimension of the range space for 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<msub><mi mathvariant='italic'>r</mi>
<mi mathvariant='italic'>k</mi>
</msub>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>u</mi>
<mo stretchy="false">)</mo>
</mrow></math>

;
i.e., 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>p</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">)</mo>
</mrow></math>

 in
the <a href="cppad_ipopt_nlp.xml#fg(x).Representation" target="_top"><span style='white-space: nowrap'>representation</span></a>
 above.
<code><span style='white-space: nowrap'><br/>
<br/>
</span></code>The <code><font color="blue">cppad_ipopt_h_base</font></code> implementation of this function
corresponds to the simple representation mentioned above; i.e.,

<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>p</mi>
<mo stretchy="false">=</mo>
<mi mathvariant='italic'>m</mi>
<mo stretchy="false">+</mo>
<mn>1</mn>
</mrow></math>

.

<br/>
<br/>
<b><a name="fg_info.fg_info.number_terms" id="fg_info.fg_info.number_terms">fg_info.number_terms</a></b>
<br/>
This member function has prototype

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;virtual&#xA0;size_t&#xA0;cppad_ipopt_fg_info::number_terms(size_t&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>k</span></font></i><font color="blue"><span style='white-space: nowrap'>)<br/>
</span></font></code>
If 
<code><i><font color="black"><span style='white-space: nowrap'>k</span></font></i></code>
 in 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mo stretchy="false">{</mo>
<mn>0</mn>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02026;</mo>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>K</mi>
<mn>-1</mn>
<mo stretchy="false">}</mo>
</mrow></math>

 has type <code><font color="blue">size_t</font></code>,
and 
<code><i><font color="black"><span style='white-space: nowrap'>L</span></font></i></code>
 has type <code><font color="blue">size_t</font></code>, the syntax

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>L</span></font></i><font color="blue"><span style='white-space: nowrap'>&#xA0;=&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>fg_info</span></font></i><font color="blue"><span style='white-space: nowrap'>.number_terms(</span></font><i><font color="black"><span style='white-space: nowrap'>k</span></font></i><font color="blue"><span style='white-space: nowrap'>)<br/>
</span></font></code>
sets 
<code><i><font color="black"><span style='white-space: nowrap'>L</span></font></i></code>
 to the number of terms in representation
for this value of 
<code><i><font color="black"><span style='white-space: nowrap'>k</span></font></i></code>
;
i.e., 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>L</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">)</mo>
</mrow></math>

 in
the <a href="cppad_ipopt_nlp.xml#fg(x).Representation" target="_top"><span style='white-space: nowrap'>representation</span></a>
 above.
<code><span style='white-space: nowrap'><br/>
<br/>
</span></code>The <code><font color="blue">cppad_ipopt_h_base</font></code> implementation of this function
corresponds to the simple representation mentioned above; i.e.,

<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>L</mi>
<mo stretchy="false">=</mo>
<mn>1</mn>
</mrow></math>

.

<br/>
<br/>
<b><a name="fg_info.fg_info.index" id="fg_info.fg_info.index">fg_info.index</a></b>
<br/>
This member function has prototype

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;virtual&#xA0;void&#xA0;cppad_ipopt_fg_info::index(<br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;size_t&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>k</span></font></i><font color="blue"><span style='white-space: nowrap'>,&#xA0;size_t&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>ell</span></font></i><font color="blue"><span style='white-space: nowrap'>,&#xA0;SizeVector&amp;&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>I</span></font></i><font color="blue"><span style='white-space: nowrap'>,&#xA0;SizeVector&amp;&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>J</span></font></i><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;)<br/>
</span></font></code>
The argument 

<code><i><font color="black"><span style='white-space: nowrap'>&#xA0;<br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;k<br/>
</span></font></i></code>
has type 
<code><font color="blue"><span style='white-space: nowrap'>size_t</span></font></code>

and is a value between zero and 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>K</mi>
<mn>-1</mn>
</mrow></math>

 inclusive.
The argument 

<code><i><font color="black"><span style='white-space: nowrap'>&#xA0;<br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;ell<br/>
</span></font></i></code>
has type 
<code><font color="blue"><span style='white-space: nowrap'>size_t</span></font></code>

and is a value between zero and 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>L</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">)</mo>
<mn>-1</mn>
</mrow></math>

 inclusive.
The argument 

<code><i><font color="black"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;I<br/>
</span></font></i></code>
is a <a href="simplevector.xml" target="_top"><span style='white-space: nowrap'>SimpleVector</span></a>
 with elements
of type <code><font color="blue">size_t</font></code> and size greater than or equal to 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>p</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">)</mo>
</mrow></math>

.
The input value of the elements of 
<code><i><font color="black"><span style='white-space: nowrap'>I</span></font></i></code>
 does not matter.
The output value of
the first 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>p</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">)</mo>
</mrow></math>

 elements of 
<code><i><font color="black"><span style='white-space: nowrap'>I</span></font></i></code>
 
must be the corresponding elements of 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<msub><mi mathvariant='italic'>I</mi>
<mrow><mi mathvariant='italic'>k</mi>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>ell</mi>
</mrow>
</msub>
</mrow></math>

 
in the <a href="cppad_ipopt_nlp.xml#fg(x).Representation" target="_top"><span style='white-space: nowrap'>representation</span></a>
 above.
The argument 

<code><i><font color="black"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;J<br/>
</span></font></i></code>
is a <a href="simplevector.xml" target="_top"><span style='white-space: nowrap'>SimpleVector</span></a>
 with elements
of type <code><font color="blue">size_t</font></code> and size greater than or equal to 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>q</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">)</mo>
</mrow></math>

.
The input value of the elements of 
<code><i><font color="black"><span style='white-space: nowrap'>J</span></font></i></code>
 does not matter.
The output value of 
the first 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>q</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">)</mo>
</mrow></math>

 elements of 
<code><i><font color="black"><span style='white-space: nowrap'>J</span></font></i></code>
 
must be the corresponding elements of 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<msub><mi mathvariant='italic'>J</mi>
<mrow><mi mathvariant='italic'>k</mi>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>ell</mi>
</mrow>
</msub>
</mrow></math>

 
in the <a href="cppad_ipopt_nlp.xml#fg(x).Representation" target="_top"><span style='white-space: nowrap'>representation</span></a>
 above.
<code><span style='white-space: nowrap'><br/>
<br/>
</span></code>The <code><font color="blue">cppad_ipopt_h_base</font></code> implementation of this function
corresponds to the simple representation mentioned above; i.e.,
for 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>i</mi>
<mo stretchy="false">=</mo>
<mn>0</mn>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02026;</mo>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>m</mi>
</mrow></math>

,

<code><i><font color="black"><span style='white-space: nowrap'>I</span></font></i><font color="blue"><span style='white-space: nowrap'>[</span></font><i><font color="black"><span style='white-space: nowrap'>i</span></font></i><font color="blue"><span style='white-space: nowrap'>]&#xA0;=&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>i</span></font></i></code>
,
and  for 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>j</mi>
<mo stretchy="false">=</mo>
<mn>0</mn>
<mo stretchy="false">,</mo>
<mo stretchy="false">&#x02026;</mo>
<mo stretchy="false">,</mo>
<mi mathvariant='italic'>n</mi>
<mn>-1</mn>
</mrow></math>

,

<code><i><font color="black"><span style='white-space: nowrap'>J</span></font></i><font color="blue"><span style='white-space: nowrap'>[</span></font><i><font color="black"><span style='white-space: nowrap'>j</span></font></i><font color="blue"><span style='white-space: nowrap'>]&#xA0;=&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>j</span></font></i></code>
.

<br/>
<br/>
<b><big><a name="solution" id="solution">solution</a></big></b>
<br/>
After the optimization process is completed, 
<code><i><font color="black"><span style='white-space: nowrap'>solution</span></font></i></code>
 contains
the following information:

<br/>
<br/>
<b><a name="solution.status" id="solution.status">status</a></b>
<br/>
The 
<code><i><font color="black"><span style='white-space: nowrap'>status</span></font></i></code>
 field of 
<code><i><font color="black"><span style='white-space: nowrap'>solution</span></font></i></code>
 has prototype

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;cppad_ipopt_solution::solution_status&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>solution</span></font></i><font color="blue"><span style='white-space: nowrap'>.status<br/>
</span></font></code>
It is the final Ipopt status for the optimizer. 
Here is a list of the possible values for the status:

<table><tr><td align='left'  valign='top'>


<code><i><font color="black"><span style='white-space: nowrap'>status</span></font></i></code>
 </td><td align='left'  valign='top'>
 Meaning
</td></tr><tr><td align='left'  valign='top'>

not_defined </td><td align='left'  valign='top'>

The optimizer did not return a final status to this <code><font color="blue">cppad_ipopt_nlp</font></code>
object.
</td></tr><tr><td align='left'  valign='top'>

unknown </td><td align='left'  valign='top'>

The status returned by the optimizer is not defined in the Ipopt
documentation for <code><font color="blue">finalize_solution</font></code>.
</td></tr><tr><td align='left'  valign='top'>

success </td><td align='left'  valign='top'>

Algorithm terminated successfully at a point satisfying the convergence 
tolerances (see Ipopt options).
</td></tr><tr><td align='left'  valign='top'>

maxiter_exceeded </td><td align='left'  valign='top'>

The maximum number of iterations was exceeded (see Ipopt options).
</td></tr><tr><td align='left'  valign='top'>

stop_at_tiny_step </td><td align='left'  valign='top'>

Algorithm terminated because progress was very slow.
</td></tr><tr><td align='left'  valign='top'>

stop_at_acceptable_point </td><td align='left'  valign='top'>

Algorithm stopped at a point that was converged, 
not to the 'desired' tolerances, but to 'acceptable' tolerances 
(see Ipopt options).
</td></tr><tr><td align='left'  valign='top'>

local_infeasibility </td><td align='left'  valign='top'>

Algorithm converged to a non-feasible point
(problem may have no solution).
</td></tr><tr><td align='left'  valign='top'>

user_requested_stop </td><td align='left'  valign='top'>

This return value should not happen.
</td></tr><tr><td align='left'  valign='top'>

diverging_iterates </td><td align='left'  valign='top'>

It the iterates are diverging.
</td></tr><tr><td align='left'  valign='top'>

restoration_failure </td><td align='left'  valign='top'>

Restoration phase failed, algorithm doesn't know how to proceed.
</td></tr><tr><td align='left'  valign='top'>

error_in_step_computation </td><td align='left'  valign='top'>

An unrecoverable error occurred while Ipopt tried to 
compute the search direction.
</td></tr><tr><td align='left'  valign='top'>

invalid_number_detected </td><td align='left'  valign='top'>

Algorithm received an invalid number (such as <code><font color="blue">nan</font></code> or <code><font color="blue">inf</font></code>) 
from the users function 
<code><i><font color="black"><span style='white-space: nowrap'>fg_info</span></font></i><font color="blue"><span style='white-space: nowrap'>.eval</span></font></code>
 or from the CppAD evaluations
of its derivatives
(see the Ipopt option <code><font color="blue">check_derivatives_for_naninf</font></code>).
</td></tr><tr><td align='left'  valign='top'>

internal_error </td><td align='left'  valign='top'>

An unknown Ipopt internal error occurred.
Contact the Ipopt authors through the mailing list.
</td></tr>
</table>
<br/>
<b><a name="solution.x" id="solution.x">x</a></b>
<br/>
The <code><font color="blue">x</font></code> field of 
<code><i><font color="black"><span style='white-space: nowrap'>solution</span></font></i></code>
 has prototype

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;NumberVector&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>solution</span></font></i><font color="blue"><span style='white-space: nowrap'>.x<br/>
</span></font></code>
and its size is equal to 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>n</mi>
</mrow></math>

.
It is the final 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>x</mi>
</mrow></math>

 value for the optimizer.

<br/>
<br/>
<b><a name="solution.z_l" id="solution.z_l">z_l</a></b>
<br/>
The <code><font color="blue">z_l</font></code> field of 
<code><i><font color="black"><span style='white-space: nowrap'>solution</span></font></i></code>
 has prototype

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;NumberVector&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>solution</span></font></i><font color="blue"><span style='white-space: nowrap'>.z_l<br/>
</span></font></code>
and its size is equal to 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>n</mi>
</mrow></math>

.
It is the final Lagrange multipliers for the 
lower bounds on 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>x</mi>
</mrow></math>

.

<br/>
<br/>
<b><a name="solution.z_u" id="solution.z_u">z_u</a></b>
<br/>
The <code><font color="blue">z_u</font></code> field of 
<code><i><font color="black"><span style='white-space: nowrap'>solution</span></font></i></code>
 has prototype

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;NumberVector&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>solution</span></font></i><font color="blue"><span style='white-space: nowrap'>.z_u<br/>
</span></font></code>
and its size is equal to 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>n</mi>
</mrow></math>

.
It is the final Lagrange multipliers for the 
upper bounds on 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>x</mi>
</mrow></math>

.

<br/>
<br/>
<b><a name="solution.g" id="solution.g">g</a></b>
<br/>
The <code><font color="blue">g</font></code> field of 
<code><i><font color="black"><span style='white-space: nowrap'>solution</span></font></i></code>
 has prototype

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;NumberVector&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>solution</span></font></i><font color="blue"><span style='white-space: nowrap'>.g<br/>
</span></font></code>
and its size is equal to 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>m</mi>
</mrow></math>

.
It is the final value for the constraint function 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>g</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>x</mi>
<mo stretchy="false">)</mo>
</mrow></math>

.

<br/>
<br/>
<b><a name="solution.lambda" id="solution.lambda">lambda</a></b>
<br/>
The <code><font color="blue">lambda</font></code> field of 
<code><i><font color="black"><span style='white-space: nowrap'>solution</span></font></i></code>
 has prototype

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;NumberVector&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>solution</span></font></i><font color="blue"><span style='white-space: nowrap'>.lambda<br/>
</span></font></code>
and its size is equal to 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>m</mi>
</mrow></math>

.
It is the final value for the 
Lagrange multipliers corresponding to the constraint function.

<br/>
<br/>
<b><a name="solution.obj_value" id="solution.obj_value">obj_value</a></b>
<br/>
The <code><font color="blue">obj_value</font></code> field of 
<code><i><font color="black"><span style='white-space: nowrap'>solution</span></font></i></code>
 has prototype

<code><font color="blue"><span style='white-space: nowrap'><br/>
&#xA0;&#xA0;&#xA0;&#xA0;&#xA0;Number&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>solution</span></font></i><font color="blue"><span style='white-space: nowrap'>.obj_value<br/>
</span></font></code>
It is the final value of the objective function 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>f</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>x</mi>
<mo stretchy="false">)</mo>
</mrow></math>

.




<br/>
<br/>
<b><big><a name="Example" id="Example">Example</a></big></b>
<br/>
The file 
<a href="ipopt_nlp_get_started.cpp.xml" target="_top"><span style='white-space: nowrap'>ipopt_nlp_get_started.cpp</span></a>
 is an example and test of 
<code><font color="blue">cppad_ipopt_nlp</font></code>  that uses the 
<a href="cppad_ipopt_nlp.xml#Simple Representation" target="_top"><span style='white-space: nowrap'>simple&#xA0;representation</span></a>
.
It returns true if it succeeds and false otherwise.
The section <a href="ipopt_nlp_ode.xml" target="_top"><span style='white-space: nowrap'>ipopt_nlp_ode</span></a>
 discusses an example that
uses a more complex representation.

<br/>
<br/>
<b><big><a name="Wish List" id="Wish List">Wish List</a></big></b>
<br/>
This is a list of possible future improvements to 
<code><font color="blue">cppad_ipopt_nlp</font></code> that would require changed to the user interface:
<ol type="1"><li>
The routine 
<code><font color="blue"><span style='white-space: nowrap'>fg_info.eval_r(</span></font><i><font color="black"><span style='white-space: nowrap'>k</span></font></i><font color="blue"><span style='white-space: nowrap'>,&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>u</span></font></i><font color="blue"><span style='white-space: nowrap'>)</span></font></code>
 should also support 

<code><font color="blue"><span style='white-space: nowrap'>NumberVector</span></font></code>
 for the type of the argument <code><font color="blue">u</font></code>
(this would certainly be more efficient when 

<code><font color="blue"><span style='white-space: nowrap'>fg_info.retape(</span></font><i><font color="black"><span style='white-space: nowrap'>k</span></font></i><font color="blue"><span style='white-space: nowrap'>)</span></font></code>
 is true and 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mi mathvariant='italic'>L</mi>
<mo stretchy="false">(</mo>
<mi mathvariant='italic'>k</mi>
<mo stretchy="false">)</mo>
<mo stretchy="false">&gt;</mo>
<mn>1</mn>
</mrow></math>

).
It could be an option for the user to provide this as well as
the necessary <code><font color="blue">ADVector</font></code> definition.
</li><li>

There should a <a href="discrete.xml" target="_top"><span style='white-space: nowrap'>Discrete</span></a>
 routine that the user can call
to determine the value of 
<math xmlns="http://www.w3.org/1998/Math/MathML" display="inline"><mrow>
<mo stretchy="false">&#x02113;</mo>
</mrow></math>

 during the evaluation of

<code><font color="blue"><span style='white-space: nowrap'>fg_info.eval_r(</span></font><i><font color="black"><span style='white-space: nowrap'>k</span></font></i><font color="blue"><span style='white-space: nowrap'>,&#xA0;</span></font><i><font color="black"><span style='white-space: nowrap'>u</span></font></i><font color="blue"><span style='white-space: nowrap'>)</span></font></code>
.
This way data, which does not affect the derivative values,
can be included in the function recording and evaluation.
</li></ol>



<hr/>Input File: cppad_ipopt/src/cppad_ipopt_nlp.hpp

</body>
</html>
