Statistics
| Revision:

root / branches / pthreads-737 / docs / manuals / autodif / minimize.cpp @ 765

History | View | Annotate | Download (520 Bytes)

1
\begin{lstlisting}
2
//file: minimize.cpp
3

    
4
#include <fvar.hpp>
5

    
6
double userfun(dvar_vector&);
7

    
8
#ifdef __BCPLUSPLUS__
9
  extern unsigned _stklen = 20000;
10
#endif
11
#ifdef __ZTC__
12
  long _stack = 20000;
13
#endif
14
void main()
15
{
16
  int nvar=60;
17
  independent_variables x(1,nvar);
18
  fmm fmc(nvar); // creates the function minimizing   control structure
19
  double minimum_value= fmc.minimize(x,userfun); //Call the function minimizer
20
  cout << "The minimum value = " << minimum_value << "at x =\n"
21
       << x << "\n";
22
}
23
\end{lstlisting}