45 t= t *( fmax-
fmin ) + fmin;
50 fpen+=.1*(x+12.)*(x+12.);
55 fpen+=.1*(x-12.)*(x-12.);
70 ad_printf(
"variable out of bounds in dftinv\nvariable = %lg", x);
74 x=
dmin(fmin+.001,fmin+.01*(fmax-fmin));
77 double tinv =
tan( ((x-fmin)/(fmax-fmin) -.5) *
PI);
92 return boundp(x/s,fmin,fmax,_fpen);
109 double diff=fmax-
fmin;
110 const double l4=
log(4.0);
111 dvariable ss=0.4999999999999999*
sin(x*1.57079632679489661)+0.50;
115 double pen=.000001/diff;
116 fpen-=pen*(
log(ss+1.e-40)+
log((1.0-ss)+1.e-40)+l4);
120 fpen+=
cube(-0.9999-x);
123 fpen+=1.e+6*
cube(-1.0-x);
126 fpen+=1.e+10*
cube(-1.02-x);
132 fpen+=
cube(x-0.9999);
135 fpen+=1.e+6*
cube(x-1.);
138 fpen+=1.e+10*
cube(x-1.02);
147 double diff=fmax-
fmin;
174 return (fmax-fmin)*0.499999999999999*1.57079632679489661
175 *
cos(x*1.57079632679489661);
179 double diff=fmax-
fmin;
214 return (fmax-fmin)*0.499999999999999*1.57079632679489661
215 *
cos(x*1.57079632679489661);
219 double diff=fmax-
fmin;
249 double diff=fmax-
fmin;
250 double ss=0.49999999999999999*
sin(x*1.57079632679489661)+0.50;
256 double diff=fmax-
fmin;
286 return (
boundp(x,fmin,fmax,fpen)-2.*
boundp(x+1.e-6,fmin,fmax,fpen)
287 +
boundp(x+2.e-6,fmin,fmax,fpen))/1.e-12;
291 return (
boundp(x-2.e-6,fmin,fmax,fpen)-2.*
boundp(x-1.e-6,fmin,fmax,fpen)
292 +
boundp(x,fmin,fmax,fpen))/1.e-12;
296 return (
boundp(x+1.e-6,fmin,fmax,fpen)-2.*
boundp(x,fmin,fmax,fpen)
297 +
boundp(x-1.e-6,fmin,fmax,fpen))/1.e-12;
310 double boundp(
double x,
double fmin,
double fmax,
const double& _fpen)
315 double& fpen=(
double&) _fpen;
316 double diff=fmax-
fmin;
317 const double l4=
log(4.0);
318 double ss=0.499999999999999*
sin(x*1.57079632679489661)+0.50;
321 double pen=.001/diff;
322 fpen-=pen*(
log(ss+1.e-40)+
log((1.0-ss)+1.e-40)+l4);
326 fpen+=(x+0.9999)*(x+0.9999);
329 fpen+=1.e+6*(x+1.)*(x+1.);
332 fpen+=1.e+10*(x+1.02)*(x+1.02);
338 fpen+=(x-0.9999)*(x-0.9999);
341 fpen+=1.e+6*(x-1.)*(x-1.);
344 fpen+=1.e+10*(x-1.02)*(x-1.02);
353 double diff=fmax-
fmin;
395 ad_printf(
"variable out of bounds in boundpin: variable = %lg", x);
398 x=
dmin(fmin+.001,fmin+.01*(fmax-fmin));
403 ad_printf(
"variable out of bounds in boundpin: variable = %lg", x);
407 x=
dmax(fmax-.001,fmax-.01*(fmax-fmin));
413 tinv=
::asin(2.*(x-fmin)/(fmax-fmin)-1.)/1.57079632679489661;
419 double y=1.e-20+(fmax-
x)/(1.e-20+(x-fmin));
454 ad_printf(
"variable out of bounds in boundpin: variable = %lg", x);
458 x=
dmin(fmin+.001,fmin+.01*(fmax-fmin));
463 ad_printf(
"variable out of bounds in boundpin: variable = %lg", x);
467 x=
dmax(fmax-.001,fmax-.01*(fmax-fmin));
471 tinv=
::asin(2.*(x-fmin)/(fmax-fmin)-1.)/1.57079632679489661;
478 double y=1.e-20+(fmax-
x)/(1.e-20+(x-fmin));
Base class for dvariable.
d3_array tan(const d3_array &arr3)
Returns d3_array results with computed tan from elements in arr3.
void fmin(double f, const independent_variables &x, const dvector &g, const int &n, const dvector &w, const dvector &h, const fmm_control &fmc)
df1_one_variable atan(const df1_one_variable &x)
d3_array sin(const d3_array &arr3)
Returns d3_array results with computed sin from elements in arr3.
d3_array cube(const d3_array &m)
Description not yet available.
double nd2fboundp(double x, double fmin, double fmax, const double &fpen)
Scale input variable between upper and lower bounds and compute a penalty for exceeding the bounds...
double boundpin(double x, double fmin, double fmax, double s)
Scale model variable over [-1,1]; constant objects.
dvariable dfatan1(dvariable x, double fmin, double fmax, const prevariable &_fpen)
Scale input variable between upper and lower bounds and compute a penalty for exceeding the bounds...
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
d3_array exp(const d3_array &arr3)
Returns d3_array results with computed exp from elements in arr3.
double ndfboundp(double x, double fmin, double fmax, const double &fpen)
Derivatative code for double nd2fboundp( double x, double fmin, double fmax,const double& fpen) ...
double dftinv(double x, double fmin, double fmax)
Inverse of dvariable dfatan1(dvariable x, double fmin, double fmax, const prevariable& _fpen) ...
d3_array cos(const d3_array &arr3)
Returns d3_array results with computed cos from elements in arr3.
static int Hybrid_bounded_flag
dvariable dfboundp(const prevariable &x, double fmin, double fmax)
Computes the derivative of dvariable boundp(const prevariable& x, double fmin, double fmax...
dvariable boundp(const prevariable &x, double fmin, double fmax, const prevariable &_fpen, double s)
Compute penalty for exceeding bounds on parameter; variable ojbects.
dvector value(const df1_one_vector &v)
double square(const double value)
Return square of value; constant object.
Fundamental data type for reverse mode automatic differentiation.
d3_array log(const d3_array &arr3)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
int ad_printf(FILE *stream, const char *format, Args...args)
dvector asin(const dvector &vec)
Returns dvector with principal value of the arc sine of vec, expressed in radians.