19 #if defined(__TURBOC__)
25 #if defined (__WAT32__) || defined(_MSC_VER)
35 #include <iostream.hpp>
47 extern "C" void onintr(
int k);
50 #include <iostream.hxx>
80 const double stepsize=1.e-5;
87 double scder=r*(g1-g2)/(2.0*stepsize);
88 cout << std::scientific < setprecision(10) <<
" f = " << f <<
endl;
89 cout <<
" second derivative = " ;
90 cout <<
" r*(g1-g)/stepsize = " << scder <<
endl;
109 int itn=0;
int smallbreak=0;
int midbreak=0;
112 double a,f, curf, stepsize,b,epsilon;
118 dvector curx(1,nvar), g1(1,nvar), xtry(1,nvar), g(1,nvar), r(1,nvar);
121 cout << std::scientific < setprecision(10) <<
" f = " << f <<
endl;
128 cout <<
" norm(g) = " <<
norm(g) ;
129 cout <<
" r*g/norm(g) = " << r*g/
norm(g) <<
endl;
140 xtry=curx+stepsize*r; x=xtry;
143 cout << std::scientific < setprecision(10) <<
" f = " << f <<
endl;
144 cout <<
" r*g/norm(g) = " << r*g/
norm(g) <<
endl;
157 cout << setprecision(10) << f-curf <<
endl;
158 stepsize=0.001*stepsize; xtry=curx+stepsize*r;
202 xrho(k1)=1./(y(k1)*s(k1));
216 alpha(i-lb)=xrho(i1)*(s(i1)*t);
222 t-=alpha(i-lb)*y(i1);
229 r+= (alpha(i-lb)-xrho(i1)*(y(i1)*r)) * s(i1);
Vector of double precision numbers.
df1_two_variable fabs(const df1_two_variable &x)
static dvariable reset(const dvar_vector &x)
double norm(const d3_array &a)
Return computed norm value of a.
void gradcalc(int nvar, const dvector &g)
double get_second_derivative(double f, independent_variables &x, dvector &g, dvector &r, int nvar, function_minimizer *pmp)
Description not yet available.
dvector update1(int nvar, int iter, int m, const dvector &g, const dmatrix &xalpha, dmatrix &y, const dvector &x, const dvector &xold, const dvector &gold, const dvector &xrho)
Description not yet available.
prnstream & endl(prnstream &)
Description not yet available.
void fmin2(const double &f, const independent_variables &x, const dvector &g, function_minimizer *)
Description not yet available.
static objective_function_value * pobjfun
Description not yet available.
static void xinit(const dvector &x)
dvariable beta(const prevariable &a, const prevariable &b)
Beta density function.
Description not yet available.
double dafsqrt(double x)
Robust square root.
void do_evaluation(double &f, independent_variables &x, dvector &g, int nvar, function_minimizer *pmp)
Description not yet available.
Description not yet available.
dvector value(const df1_one_vector &v)
virtual void userfunction(void)=0
Fundamental data type for reverse mode automatic differentiation.