Codebase list cppad / debian/2017.00.00.8-1 doc / ipopt_solve_get_started.cpp.xml
debian/2017.00.00.8-1

Tree @debian/2017.00.00.8-1 (Download .tar.gz)

ipopt_solve_get_started.cpp.xml @debian/2017.00.00.8-1raw · history · blame

<?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 CppAD and Ipopt: Example and Test</title>
<meta http-equiv='Content-Type' content='text/html' charset='utf-8'/>
<meta name="description" id="description" content="Nonlinear Programming Using CppAD and Ipopt: Example and Test"/>
<meta name="keywords" id="keywords" content=" nonlinear programming using cppad ipopt: example test ipopt Ad purpose configuration requirement "/>
<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='_ipopt_solve_get_started.cpp_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="ipopt_solve.xml" target="_top">Prev</a>
</td><td><a href="ipopt_solve_retape.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>ipopt_solve</option>
<option>ipopt_solve_get_started.cpp</option>
</select>
</td>
<td>
<select onchange='choose_down2(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>utility</option>
<option>ipopt_solve</option>
<option>Example</option>
<option>speed</option>
<option>Appendix</option>
</select>
</td>
<td>
<select onchange='choose_down1(this)'>
<option>ipopt_solve-&gt;</option>
<option>ipopt_solve_get_started.cpp</option>
<option>ipopt_solve_retape.cpp</option>
<option>ipopt_solve_ode_inverse.cpp</option>
</select>
</td>
<td>ipopt_solve_get_started.cpp</td>
<td>
<select onchange='choose_current0(this)'>
<option>Headings-&gt;</option>
<option>Purpose</option>
<option>Configuration Requirement</option>
</select>
</td>
</tr></table><br/>



<center><b><big><big>Nonlinear Programming Using CppAD and Ipopt: Example and Test</big></big></b></center>
<br/>
<b><big><a name="Purpose" id="Purpose">Purpose</a></big></b>
<br/>
This example program demonstrates how to use <a href="ipopt_solve.xml" target="_top"><span style='white-space: nowrap'>ipopt_solve</span></a>
 to
solve the example problem in the Ipopt documentation; i.e., the problem

<math xmlns="http://www.w3.org/1998/Math/MathML" display="block"><mrow>
<mtable rowalign="center" ><mtr><mtd columnalign="left" >
<mrow><mstyle mathvariant='normal'><mi mathvariant='normal'>minimize</mi>
<mspace width='.3em'/>
</mstyle></mrow>
</mtd><mtd columnalign="center" >
<msub><mi mathvariant='italic'>x</mi>
<mn>1</mn>
</msub>
<mo stretchy="false">*</mo>
<msub><mi mathvariant='italic'>x</mi>
<mn>4</mn>
</msub>
<mo stretchy="false">*</mo>
<mo stretchy="false">(</mo>
<msub><mi mathvariant='italic'>x</mi>
<mn>1</mn>
</msub>
<mo stretchy="false">+</mo>
<msub><mi mathvariant='italic'>x</mi>
<mn>2</mn>
</msub>
<mo stretchy="false">+</mo>
<msub><mi mathvariant='italic'>x</mi>
<mn>3</mn>
</msub>
<mo stretchy="false">)</mo>
<mo stretchy="false">+</mo>
<msub><mi mathvariant='italic'>x</mi>
<mn>3</mn>
</msub>
</mtd></mtr><mtr><mtd columnalign="left" >
<mrow><mstyle mathvariant='normal'><mi mathvariant='normal'>subject</mi>
<mspace width='.3em'/>
<mi mathvariant='normal'>to</mi>
<mspace width='.3em'/>
</mstyle></mrow>
</mtd><mtd columnalign="center" >
<msub><mi mathvariant='italic'>x</mi>
<mn>1</mn>
</msub>
<mo stretchy="false">*</mo>
<msub><mi mathvariant='italic'>x</mi>
<mn>2</mn>
</msub>
<mo stretchy="false">*</mo>
<msub><mi mathvariant='italic'>x</mi>
<mn>3</mn>
</msub>
<mo stretchy="false">*</mo>
<msub><mi mathvariant='italic'>x</mi>
<mn>4</mn>
</msub>
<mo stretchy="false">&#x02265;</mo>
<mn>25</mn>
</mtd></mtr><mtr><mtd columnalign="left" >
</mtd><mtd columnalign="center" >
<msubsup><mi mathvariant='italic'>x</mi>
<mn>1</mn>
<mn>2</mn>
</msubsup>
<mo stretchy="false">+</mo>
<msubsup><mi mathvariant='italic'>x</mi>
<mn>2</mn>
<mn>2</mn>
</msubsup>
<mo stretchy="false">+</mo>
<msubsup><mi mathvariant='italic'>x</mi>
<mn>3</mn>
<mn>2</mn>
</msubsup>
<mo stretchy="false">+</mo>
<msubsup><mi mathvariant='italic'>x</mi>
<mn>4</mn>
<mn>2</mn>
</msubsup>
<mo stretchy="false">=</mo>
<mn>40</mn>
</mtd></mtr><mtr><mtd columnalign="left" >
</mtd><mtd columnalign="center" >
<mn>1</mn>
<mo stretchy="false">&#x02264;</mo>
<msub><mi mathvariant='italic'>x</mi>
<mn>1</mn>
</msub>
<mo stretchy="false">,</mo>
<msub><mi mathvariant='italic'>x</mi>
<mn>2</mn>
</msub>
<mo stretchy="false">,</mo>
<msub><mi mathvariant='italic'>x</mi>
<mn>3</mn>
</msub>
<mo stretchy="false">,</mo>
<msub><mi mathvariant='italic'>x</mi>
<mn>4</mn>
</msub>
<mo stretchy="false">&#x02264;</mo>
<mn>5</mn>
</mtd></mtr></mtable>
</mrow></math>

<br/>
<b><big><a name="Configuration Requirement" id="Configuration Requirement">Configuration Requirement</a></big></b>
<br/>
This example will be compiled and tested provided that
<a href="ipopt_prefix.xml" target="_top"><span style='white-space: nowrap'>ipopt_prefix</span></a>
 is specified on the <a href="cmake.xml" target="_top"><span style='white-space: nowrap'>cmake</span></a>
 command line.

<code><font color="blue">
<pre><tt><span style="font-weight: bold"><span style="color: #000080"># include</span></span> <span style="color: #FF0000">&lt;cppad/ipopt/solve.hpp&gt;</span>

<span style="font-weight: bold"><span style="color: #0000FF">namespace</span></span> <span style="color: #FF0000">{</span>
     <span style="font-weight: bold"><span style="color: #0000FF">using</span></span> CppAD<span style="color: #990000">::</span>AD<span style="color: #990000">;</span>

     <span style="font-weight: bold"><span style="color: #0000FF">class</span></span> <span style="color: #008080">FG_eval</span> <span style="color: #FF0000">{</span>
     <span style="font-weight: bold"><span style="color: #0000FF">public</span></span><span style="color: #990000">:</span>
          <span style="font-weight: bold"><span style="color: #0000FF">typedef</span></span> <span style="font-weight: bold"><span style="color: #000000">CPPAD_TESTVECTOR</span></span><span style="color: #990000">(</span> AD<span style="color: #990000">&lt;</span><span style="color: #009900">double</span><span style="color: #990000">&gt;</span> <span style="color: #990000">)</span> ADvector<span style="color: #990000">;</span>
          <span style="color: #009900">void</span> <span style="font-weight: bold"><span style="color: #0000FF">operator</span></span><span style="color: #990000">()(</span>ADvector<span style="color: #990000">&amp;</span> fg<span style="color: #990000">,</span> <span style="font-weight: bold"><span style="color: #0000FF">const</span></span> ADvector<span style="color: #990000">&amp;</span> x<span style="color: #990000">)</span>
          <span style="color: #FF0000">{</span>     <span style="font-weight: bold"><span style="color: #000000">assert</span></span><span style="color: #990000">(</span> fg<span style="color: #990000">.</span><span style="font-weight: bold"><span style="color: #000000">size</span></span><span style="color: #990000">()</span> <span style="color: #990000">==</span> <span style="color: #993399">3</span> <span style="color: #990000">);</span>
               <span style="font-weight: bold"><span style="color: #000000">assert</span></span><span style="color: #990000">(</span> x<span style="color: #990000">.</span><span style="font-weight: bold"><span style="color: #000000">size</span></span><span style="color: #990000">()</span>  <span style="color: #990000">==</span> <span style="color: #993399">4</span> <span style="color: #990000">);</span>

               <span style="font-style: italic"><span style="color: #9A1900">// Fortran style indexing</span></span>
               <span style="color: #008080">AD&lt;double&gt;</span> x1 <span style="color: #990000">=</span> x<span style="color: #990000">[</span><span style="color: #993399">0</span><span style="color: #990000">];</span>
               <span style="color: #008080">AD&lt;double&gt;</span> x2 <span style="color: #990000">=</span> x<span style="color: #990000">[</span><span style="color: #993399">1</span><span style="color: #990000">];</span>
               <span style="color: #008080">AD&lt;double&gt;</span> x3 <span style="color: #990000">=</span> x<span style="color: #990000">[</span><span style="color: #993399">2</span><span style="color: #990000">];</span>
               <span style="color: #008080">AD&lt;double&gt;</span> x4 <span style="color: #990000">=</span> x<span style="color: #990000">[</span><span style="color: #993399">3</span><span style="color: #990000">];</span>
               <span style="font-style: italic"><span style="color: #9A1900">// f(x)</span></span>
               fg<span style="color: #990000">[</span><span style="color: #993399">0</span><span style="color: #990000">]</span> <span style="color: #990000">=</span> x1 <span style="color: #990000">*</span> x4 <span style="color: #990000">*</span> <span style="color: #990000">(</span>x1 <span style="color: #990000">+</span> x2 <span style="color: #990000">+</span> x3<span style="color: #990000">)</span> <span style="color: #990000">+</span> x3<span style="color: #990000">;</span>
               <span style="font-style: italic"><span style="color: #9A1900">// g_1 (x)</span></span>
               fg<span style="color: #990000">[</span><span style="color: #993399">1</span><span style="color: #990000">]</span> <span style="color: #990000">=</span> x1 <span style="color: #990000">*</span> x2 <span style="color: #990000">*</span> x3 <span style="color: #990000">*</span> x4<span style="color: #990000">;</span>
               <span style="font-style: italic"><span style="color: #9A1900">// g_2 (x)</span></span>
               fg<span style="color: #990000">[</span><span style="color: #993399">2</span><span style="color: #990000">]</span> <span style="color: #990000">=</span> x1 <span style="color: #990000">*</span> x1 <span style="color: #990000">+</span> x2 <span style="color: #990000">*</span> x2 <span style="color: #990000">+</span> x3 <span style="color: #990000">*</span> x3 <span style="color: #990000">+</span> x4 <span style="color: #990000">*</span> x4<span style="color: #990000">;</span>
               <span style="font-style: italic"><span style="color: #9A1900">//</span></span>
               <span style="font-weight: bold"><span style="color: #0000FF">return</span></span><span style="color: #990000">;</span>
          <span style="color: #FF0000">}</span>
     <span style="color: #FF0000">}</span><span style="color: #990000">;</span>
<span style="color: #FF0000">}</span>

<span style="color: #009900">bool</span> <span style="font-weight: bold"><span style="color: #000000">get_started</span></span><span style="color: #990000">(</span><span style="color: #009900">void</span><span style="color: #990000">)</span>
<span style="color: #FF0000">{</span>     <span style="color: #009900">bool</span> ok <span style="color: #990000">=</span> <span style="font-weight: bold"><span style="color: #0000FF">true</span></span><span style="color: #990000">;</span>
     <span style="color: #008080">size_t</span> i<span style="color: #990000">;</span>
     <span style="font-weight: bold"><span style="color: #0000FF">typedef</span></span> <span style="font-weight: bold"><span style="color: #000000">CPPAD_TESTVECTOR</span></span><span style="color: #990000">(</span> <span style="color: #009900">double</span> <span style="color: #990000">)</span> Dvector<span style="color: #990000">;</span>

     <span style="font-style: italic"><span style="color: #9A1900">// number of independent variables (domain dimension for f and g)</span></span>
     <span style="color: #008080">size_t</span> nx <span style="color: #990000">=</span> <span style="color: #993399">4</span><span style="color: #990000">;</span>
     <span style="font-style: italic"><span style="color: #9A1900">// number of constraints (range dimension for g)</span></span>
     <span style="color: #008080">size_t</span> ng <span style="color: #990000">=</span> <span style="color: #993399">2</span><span style="color: #990000">;</span>
     <span style="font-style: italic"><span style="color: #9A1900">// initial value of the independent variables</span></span>
     <span style="color: #008080">Dvector</span> <span style="font-weight: bold"><span style="color: #000000">xi</span></span><span style="color: #990000">(</span>nx<span style="color: #990000">);</span>
     xi<span style="color: #990000">[</span><span style="color: #993399">0</span><span style="color: #990000">]</span> <span style="color: #990000">=</span> <span style="color: #993399">1.0</span><span style="color: #990000">;</span>
     xi<span style="color: #990000">[</span><span style="color: #993399">1</span><span style="color: #990000">]</span> <span style="color: #990000">=</span> <span style="color: #993399">5.0</span><span style="color: #990000">;</span>
     xi<span style="color: #990000">[</span><span style="color: #993399">2</span><span style="color: #990000">]</span> <span style="color: #990000">=</span> <span style="color: #993399">5.0</span><span style="color: #990000">;</span>
     xi<span style="color: #990000">[</span><span style="color: #993399">3</span><span style="color: #990000">]</span> <span style="color: #990000">=</span> <span style="color: #993399">1.0</span><span style="color: #990000">;</span>
     <span style="font-style: italic"><span style="color: #9A1900">// lower and upper limits for x</span></span>
     <span style="color: #008080">Dvector</span> <span style="font-weight: bold"><span style="color: #000000">xl</span></span><span style="color: #990000">(</span>nx<span style="color: #990000">),</span> <span style="font-weight: bold"><span style="color: #000000">xu</span></span><span style="color: #990000">(</span>nx<span style="color: #990000">);</span>
     <span style="font-weight: bold"><span style="color: #0000FF">for</span></span><span style="color: #990000">(</span>i <span style="color: #990000">=</span> <span style="color: #993399">0</span><span style="color: #990000">;</span> i <span style="color: #990000">&lt;</span> nx<span style="color: #990000">;</span> i<span style="color: #990000">++)</span>
     <span style="color: #FF0000">{</span>     xl<span style="color: #990000">[</span>i<span style="color: #990000">]</span> <span style="color: #990000">=</span> <span style="color: #993399">1.0</span><span style="color: #990000">;</span>
          xu<span style="color: #990000">[</span>i<span style="color: #990000">]</span> <span style="color: #990000">=</span> <span style="color: #993399">5.0</span><span style="color: #990000">;</span>
     <span style="color: #FF0000">}</span>
     <span style="font-style: italic"><span style="color: #9A1900">// lower and upper limits for g</span></span>
     <span style="color: #008080">Dvector</span> <span style="font-weight: bold"><span style="color: #000000">gl</span></span><span style="color: #990000">(</span>ng<span style="color: #990000">),</span> <span style="font-weight: bold"><span style="color: #000000">gu</span></span><span style="color: #990000">(</span>ng<span style="color: #990000">);</span>
     gl<span style="color: #990000">[</span><span style="color: #993399">0</span><span style="color: #990000">]</span> <span style="color: #990000">=</span> <span style="color: #993399">25.0</span><span style="color: #990000">;</span>     gu<span style="color: #990000">[</span><span style="color: #993399">0</span><span style="color: #990000">]</span> <span style="color: #990000">=</span> <span style="color: #993399">1.0e19</span><span style="color: #990000">;</span>
     gl<span style="color: #990000">[</span><span style="color: #993399">1</span><span style="color: #990000">]</span> <span style="color: #990000">=</span> <span style="color: #993399">40.0</span><span style="color: #990000">;</span>     gu<span style="color: #990000">[</span><span style="color: #993399">1</span><span style="color: #990000">]</span> <span style="color: #990000">=</span> <span style="color: #993399">40.0</span><span style="color: #990000">;</span>

     <span style="font-style: italic"><span style="color: #9A1900">// object that computes objective and constraints</span></span>
     <span style="color: #008080">FG_eval</span> fg_eval<span style="color: #990000">;</span>

     <span style="font-style: italic"><span style="color: #9A1900">// options</span></span>
     std<span style="color: #990000">::</span><span style="color: #008080">string</span> options<span style="color: #990000">;</span>
     <span style="font-style: italic"><span style="color: #9A1900">// turn off any printing</span></span>
     options <span style="color: #990000">+=</span> <span style="color: #FF0000">"Integer print_level  0</span><span style="color: #CC33CC">\n</span><span style="color: #FF0000">"</span><span style="color: #990000">;</span>
     options <span style="color: #990000">+=</span> <span style="color: #FF0000">"String  sb           yes</span><span style="color: #CC33CC">\n</span><span style="color: #FF0000">"</span><span style="color: #990000">;</span>
     <span style="font-style: italic"><span style="color: #9A1900">// maximum number of iterations</span></span>
     options <span style="color: #990000">+=</span> <span style="color: #FF0000">"Integer max_iter     10</span><span style="color: #CC33CC">\n</span><span style="color: #FF0000">"</span><span style="color: #990000">;</span>
     <span style="font-style: italic"><span style="color: #9A1900">// approximate accuracy in first order necessary conditions;</span></span>
     <span style="font-style: italic"><span style="color: #9A1900">// see Mathematical Programming, Volume 106, Number 1,</span></span>
     <span style="font-style: italic"><span style="color: #9A1900">// Pages 25-57, Equation (6)</span></span>
     options <span style="color: #990000">+=</span> <span style="color: #FF0000">"Numeric tol          1e-6</span><span style="color: #CC33CC">\n</span><span style="color: #FF0000">"</span><span style="color: #990000">;</span>
     <span style="font-style: italic"><span style="color: #9A1900">// derivative testing</span></span>
     options <span style="color: #990000">+=</span> <span style="color: #FF0000">"String  derivative_test            second-order</span><span style="color: #CC33CC">\n</span><span style="color: #FF0000">"</span><span style="color: #990000">;</span>
     <span style="font-style: italic"><span style="color: #9A1900">// maximum amount of random pertubation; e.g.,</span></span>
     <span style="font-style: italic"><span style="color: #9A1900">// when evaluation finite diff</span></span>
     options <span style="color: #990000">+=</span> <span style="color: #FF0000">"Numeric point_perturbation_radius  0.</span><span style="color: #CC33CC">\n</span><span style="color: #FF0000">"</span><span style="color: #990000">;</span>

     <span style="font-style: italic"><span style="color: #9A1900">// place to return solution</span></span>
     CppAD<span style="color: #990000">::</span>ipopt<span style="color: #990000">::</span><span style="color: #008080">solve_result&lt;Dvector&gt;</span> solution<span style="color: #990000">;</span>

     <span style="font-style: italic"><span style="color: #9A1900">// solve the problem</span></span>
     CppAD<span style="color: #990000">::</span>ipopt<span style="color: #990000">::</span>solve<span style="color: #990000">&lt;</span>Dvector<span style="color: #990000">,</span> FG_eval<span style="color: #990000">&gt;(</span>
          options<span style="color: #990000">,</span> xi<span style="color: #990000">,</span> xl<span style="color: #990000">,</span> xu<span style="color: #990000">,</span> gl<span style="color: #990000">,</span> gu<span style="color: #990000">,</span> fg_eval<span style="color: #990000">,</span> solution
     <span style="color: #990000">);</span>
     <span style="font-style: italic"><span style="color: #9A1900">//</span></span>
     <span style="font-style: italic"><span style="color: #9A1900">// Check some of the solution values</span></span>
     <span style="font-style: italic"><span style="color: #9A1900">//</span></span>
     ok <span style="color: #990000">&amp;=</span> solution<span style="color: #990000">.</span>status <span style="color: #990000">==</span> CppAD<span style="color: #990000">::</span>ipopt<span style="color: #990000">::</span>solve_result<span style="color: #990000">&lt;</span>Dvector<span style="color: #990000">&gt;::</span>success<span style="color: #990000">;</span>
     <span style="font-style: italic"><span style="color: #9A1900">//</span></span>
     <span style="color: #009900">double</span> check_x<span style="color: #990000">[]</span>  <span style="color: #990000">=</span> <span style="color: #FF0000">{</span> <span style="color: #993399">1.000000</span><span style="color: #990000">,</span> <span style="color: #993399">4.743000</span><span style="color: #990000">,</span> <span style="color: #993399">3.82115</span><span style="color: #990000">,</span> <span style="color: #993399">1.379408</span> <span style="color: #FF0000">}</span><span style="color: #990000">;</span>
     <span style="color: #009900">double</span> check_zl<span style="color: #990000">[]</span> <span style="color: #990000">=</span> <span style="color: #FF0000">{</span> <span style="color: #993399">1.087871</span><span style="color: #990000">,</span> <span style="color: #993399">0</span><span style="color: #990000">.,</span>       <span style="color: #993399">0</span><span style="color: #990000">.,</span>      <span style="color: #993399">0</span><span style="color: #990000">.</span>       <span style="color: #FF0000">}</span><span style="color: #990000">;</span>
     <span style="color: #009900">double</span> check_zu<span style="color: #990000">[]</span> <span style="color: #990000">=</span> <span style="color: #FF0000">{</span> <span style="color: #993399">0</span><span style="color: #990000">.,</span>       <span style="color: #993399">0</span><span style="color: #990000">.,</span>       <span style="color: #993399">0</span><span style="color: #990000">.,</span>      <span style="color: #993399">0</span><span style="color: #990000">.</span>       <span style="color: #FF0000">}</span><span style="color: #990000">;</span>
     <span style="color: #009900">double</span> rel_tol    <span style="color: #990000">=</span> <span style="color: #993399">1e-6</span><span style="color: #990000">;</span>  <span style="font-style: italic"><span style="color: #9A1900">// relative tolerance</span></span>
     <span style="color: #009900">double</span> abs_tol    <span style="color: #990000">=</span> <span style="color: #993399">1e-6</span><span style="color: #990000">;</span>  <span style="font-style: italic"><span style="color: #9A1900">// absolute tolerance</span></span>
     <span style="font-weight: bold"><span style="color: #0000FF">for</span></span><span style="color: #990000">(</span>i <span style="color: #990000">=</span> <span style="color: #993399">0</span><span style="color: #990000">;</span> i <span style="color: #990000">&lt;</span> nx<span style="color: #990000">;</span> i<span style="color: #990000">++)</span>
     <span style="color: #FF0000">{</span>     ok <span style="color: #990000">&amp;=</span> CppAD<span style="color: #990000">::</span><span style="font-weight: bold"><span style="color: #000000">NearEqual</span></span><span style="color: #990000">(</span>
               check_x<span style="color: #990000">[</span>i<span style="color: #990000">],</span>  solution<span style="color: #990000">.</span>x<span style="color: #990000">[</span>i<span style="color: #990000">],</span>   rel_tol<span style="color: #990000">,</span> abs_tol
          <span style="color: #990000">);</span>
          ok <span style="color: #990000">&amp;=</span> CppAD<span style="color: #990000">::</span><span style="font-weight: bold"><span style="color: #000000">NearEqual</span></span><span style="color: #990000">(</span>
               check_zl<span style="color: #990000">[</span>i<span style="color: #990000">],</span> solution<span style="color: #990000">.</span>zl<span style="color: #990000">[</span>i<span style="color: #990000">],</span> rel_tol<span style="color: #990000">,</span> abs_tol
          <span style="color: #990000">);</span>
          ok <span style="color: #990000">&amp;=</span> CppAD<span style="color: #990000">::</span><span style="font-weight: bold"><span style="color: #000000">NearEqual</span></span><span style="color: #990000">(</span>
               check_zu<span style="color: #990000">[</span>i<span style="color: #990000">],</span> solution<span style="color: #990000">.</span>zu<span style="color: #990000">[</span>i<span style="color: #990000">],</span> rel_tol<span style="color: #990000">,</span> abs_tol
          <span style="color: #990000">);</span>
     <span style="color: #FF0000">}</span>

     <span style="font-weight: bold"><span style="color: #0000FF">return</span></span> ok<span style="color: #990000">;</span>
<span style="color: #FF0000">}</span></tt></pre>
</font></code>
<hr/>Input File: example/ipopt_solve/get_started.cpp

</body>
</html>