53 #if defined(__MINGW64__)
58 #if defined(AD_LONG_INT)
59 #error "Error: AD_LONG_INT should not be defined."
61 #define AD_LONG_INT long long int
63 #elif defined(_MSC_VER)
65 #define LSEEK _lseeki64
68 #if defined(AD_LONG_INT)
69 #error "Error: AD_LONG_INT should not be defined."
71 #define AD_LONG_INT long int
78 #if defined(AD_LONG_INT)
79 #error "Error: AD_LONG_INT should not be defined."
81 #define AD_LONG_INT long int
92 #define M_PI 3.14159265358979323846
98 #if defined(__GNUC__) && (__GNUC__ < 3)
102 #if defined(THREAD_EXPERIMENT)
106 #if defined(THREAD_SAFE)
107 # include <pthread.h>
110 #ifndef TINY_AD_USE_TINY_VEC
111 #define TINY_AD_USE_TINY_VEC 1
115 #define USE_VECTOR_SHAPE_POOL
117 #if defined(USE_DDOUBLE)
119 # define double dd_real
120 dd_real operator ++(dd_real & d)
125 dd_real
pow(
const dd_real & d,
int i);
126 dd_real
pow(
const dd_real & d,
const dd_real &);
129 #if defined(__TURBOC__)
130 # define __STL_PTHREADS
132 # include <pthread_alloc>
135 #define __NUMBERVECTOR__
140 #define ADUNCONST(type,obj) type & obj = (type&) _##obj;
142 #define MFCL2_CONSTRUCTORS
145 # define USE_EXECPTIONS
148 #define __USE_IOSTREAM__
150 #if defined(__BORLANDC__)
151 #if (__BORLANDC__ >= 0x0550)
156 #if defined(__BORLANDC__) || defined (_MSC_VER) || defined(__WAT32__)
160 #if !defined(_MSC_VER)
162 #if !defined(O_BINARY)
168 #if defined(__DJGPP__)
259 #if defined(__GNUC__) && (__GNUC__ < 3)
261 #elif defined(_MSC_VER) && (_MSC_VER < 1300)
263 #elif defined(__SUNPRO_CC) && (__SUNPRO_CC < 0x5140)
271 #if defined(__BORLANDC__)
272 # if (__BORLANDC__ < 0x0550)
274 # include <strstrea.h>
276 # include <strstream>
280 #if defined(_MSC_VER)
281 # if (_MSC_VER < 1300)
282 # include <iostream.h>
283 # include <strstrea.h>
295 # include <fstream.hpp>
296 # include <iostream.hpp>
303 # include <fstream.h>
304 # include <iostream.h>
305 # ifndef _FPOS_T_DEFINED
307 # if defined(linux) || defined(__ADSGI__)|| defined(__CYGWIN32__)
308 typedef long int fpos_t;
310 typedef unsigned long int fpos_t;
315 # define _FPOS_T_DEFINED
319 #if defined(__BORLANDC__)
320 # if (__BORLANDC__ > 0x0520)
326 #if defined(__cplusplus)
336 using std::istringstream;
337 using std::streampos;
338 using std::streambuf;
340 using std::setprecision;
341 using std::istringstream;
349 #include <strstream.h>
352 #define BEGIN_MINIMIZATION(nvar, objective_function, ind_vars, gradient, \
354 gradient_structure gs; \
355 while (cntrl.ireturn >= 0) \
357 cntrl.fmin(objective_function,ind_vars,gradient ); \
358 if (cntrl.ireturn > 0) \
360 #define END_MINIMIZATION(nvar,gradient) \
361 gradcalc(nvar, gradient); \
382 long int farptr_tolong(
void *);
383 long int _farptr_tolong(
void *);
441 #if (__BORLANDC__ >= 0x0560)
442 #define setfixed() std::fixed
444 ostream &
setfixed(
const ostream & s);
450 #if (__BORLANDC__ >= 0x0560)
451 #define setscientific() std::scientific
472 #ifndef _VECTOR_SHAPE
473 #define _VECTOR_SHAPE
511 #if defined(USE_VECTOR_SHAPE_POOL)
515 void*
operator new(size_t);
516 void operator delete(
void* ptr, size_t);
607 return (
shape == NULL);
611 return (
shape != NULL);
664 return (
shape == NULL);
692 void fill(
const char *s);
720 void write_on(
const ostream & s)
const;
786 void jacobcalc(
int nvar,
const ofstream & ofs);
789 #if defined(__BORLANDC__ )
790 #if defined(__GNUC__)
862 double*
get(
const int i)
const
880 const ofstream& jac);
972 grad_stack(
const size_t size,
const unsigned int id);
981 double *dep_addr,
double *ind_addr1 = NULL,
double mult1 = 0,
982 double *ind_addr2 = NULL,
double mult2 = 0);
985 double *dep_addr,
double *ind_addr1,
991 double *dep_addr,
double *ind_addr1);
994 double *dep_addr,
double *ind_addr1,
double mult1);
997 double *dep_addr,
double *ind_addr1,
1001 double *dep_addr,
double *ind_addr1,
1002 double mult1,
double *ind_addr2,
double mult2,
1003 double *ind_addr3,
double mult3,
1004 double *ind_addr4,
double mult4);
1007 double *dep_addr,
double *ind_addr1,
1008 double mult1,
double *ind_addr2,
double mult2,
1009 double *ind_addr3,
double mult3);
1046 double *dep_addr,
double *ind_addr1,
double mult1,
double *ind_addr2,
1053 # if defined(MYDEBUG)
1054 int wrote_buffer = 0;
1061 # if defined(MYDEBUG)
1065 # if defined(MYDEBUG)
1066 if (wrote_buffer == 1)
1068 cout <<
"WROTE BUFFER" <<
endl;
1093 double *dep_addr,
double *ind_addr1,
double mult1,
double *ind_addr2,
1094 double mult2,
double *ind_addr3,
double mult3)
1133 double *dep_addr,
double *ind_addr1,
double mult1,
double *ind_addr2,
1134 double mult2,
double *ind_addr3,
double mult3,
double *ind_addr4,
1176 double *dep_addr,
double *ind_addr1,
double *ind_addr2)
1203 double *dep_addr,
double *ind_addr1,
double mult1)
1230 double *dep_addr,
double *ind_addr1,
double *ind_addr2)
1430 #if (__BORLANDC__ >= 0x0540)
1448 #if defined(USE_DDOUBLE)
1502 return (&(v1.
v->
x));
1530 #ifdef SAFE_INITIALIZE
1620 #if defined(USE_DDOUBLE)
1622 # define double dd_real
1831 double mfexp(
double);
1832 double mfexp(
double,
double bound);
1836 #if defined(THREAD_SAFE)
1840 class ts_vector_shapex
1844 ts_vector_shapex(
int lb,
int ub,
void *p):index_min(lb),
1845 index_max(ub), ncopies(0), trueptr(p)
1848 void *get_truepointer(
void)
1857 # if defined(USE_VECTOR_SHAPE_POOL)
1859 void *
operator new(size_t);
1860 void operator delete(
void *ptr,
size_t n);
1863 unsigned int ncopies;
1868 friend class subdvector;
1872 int decr_ncopies(
void)
1876 int get_ncopies(
void)
1880 int incr_ncopies(
void)
1961 if (
get_v() ==
nullptr)
1973 double boundp(
double x,
double fmin,
double fmax,
const double &fpen);
1974 double boundp(
double x,
double fmin,
double fmax);
1981 double nd2fboundp(
double x,
double minb,
double maxb,
const double &pen);
1986 double dmin(
double,
double);
1988 double dmax(
double i,
double j);
2010 mat_shape(
int rl,
int ru,
int cl = 0,
int cu = -1);
2134 #if defined(USE_VECTOR_SHAPE_POOL)
2138 void*
operator new(size_t);
2139 void operator delete(
void* ptr, size_t);
2161 #if defined(__NUMBERVECTOR__)
2209 return (
shape == NULL);
2264 # if defined(__NUMBERVECTOR__)
2282 void write_on(
const ostream &)
const;
2299 return static_cast<unsigned int>(
2305 #if defined(__NDPX__) || defined(__SUN__)
2375 void fill(
const char *);
2505 return (
shape == NULL);
2531 void allocate(
int nrl,
int nrh,
int ncl,
int nch);
2543 # if defined(__NUMBERVECTOR__)
2581 return static_cast<unsigned int>(size < 0 ? 0 : size);
2587 return static_cast<unsigned int>(size < 0 ? 0 : size);
2626 void fill(
const char *);
2650 void write_on(
const ostream &)
const;
2669 return ((
m[i]).
va + j);
2678 return *(
double *) ((
m[i]).va + j);
2683 return *(
double *) ((
m[i]).va + j);
2694 return ((
m[i]).
va + j);
2772 throw std::bad_alloc();
2779 throw std::bad_alloc();
2848 return shape ==
nullptr;
2858 void allocate(
int nrl,
int nrh,
int ncl,
int nch);
2893 void fill(
const char *);
2936 return static_cast<unsigned int>(
rowmax() -
rowmin() + 1);
2951 return static_cast<unsigned int>(size < 0 ? 0 : size);
2956 void write_on(
const ostream &)
const;
2997 #if defined(OPT_LIB) && !defined(__INTEL_COMPILER)
3000 return (*(
m[i].v + j));
3004 return (*(
m[i].v + j));
3008 const double &
operator() (
int i,
int j)
const;
3017 return (*((*(
m + i)).v + j));
3023 inline const double &
elem(
int i,
int j)
const
3025 return (*((*(
m + i)).v + j));
3082 #if defined(OPT_LIB)
3109 double dftinv(
double,
double,
double);
3147 double sfabs(
double t1);
3205 void writeon(
const ostream & s)
const;
3255 return (
ptr == NULL);
3272 double &
elem(
int i,
int j);
3276 #if defined(OPT_LIB) && !defined(__INTEL_COMPILER)
3364 fmmt1(
int nvar,
int _xm = 7);
3381 const dvector & g,
int n,
const int &ireturn);
3387 int scroll_flag,
int noprintx = 0);
3389 void fmmdisp(
const double *x,
const double *g,
const int &nvar,
3390 int scroll_flag,
int noprintx = 0);
3401 #if defined(__TURBOC__) && (__BORLANDC__ <= 0x0520)
3402 uostream(
const char*,
int = ios::out | ios::binary,
int = filebuf::openprot);
3403 void open(
const char*,
int = ios::out | ios::binary,
int = filebuf::openprot);
3405 #if (__BORLANDC__ >= 0x0540)
3406 uostream(
const char *,
int = ios::out | ios::binary,
int protection = 666);
3407 void open(
const char *,
int = ios::out | ios::binary,
int protection = 666);
3409 #if defined (_MSC_VER) || defined (__WAT32__)
3410 #if (_MSC_VER < 1300)
3411 uostream(
const char*,
int = ios::out | ios::binary,
int = filebuf::openprot);
3412 void open(
const char*,
int = ios::out | ios::binary,
int = filebuf::openprot);
3414 uostream(
const char *,
int = ios::out | ios::binary,
int prot = 0664);
3415 void open(
const char *,
int = ios::out | ios::binary,
int prot = 0664);
3420 uostream(
const char *,
int = ios::out,
int = filebuf::openprot);
3421 void open(
const char *,
int = ios::out,
int = filebuf::openprot);
3425 uostream(
const char *,
int = ios::out,
int = filebuf::openprot);
3426 void open(
const char *,
int = ios::out,
int = filebuf::openprot);
3434 #if !defined(_MSC_VER)
3435 #if defined(__ADSGI__)
3436 uostream(
const char *name,
int mode = ios::out,
int prot = 0664);
3437 void open(
const char *name,
int mode = ios::out,
int prot = 0664);
3439 uostream(
const char *name,
int mode = ios::out | ios::binary,
3441 void open(
const char *name,
int mode = ios::out | ios::binary,
3519 #if defined (__TURBOC__) && (__BORLANDC__ <= 0x0520)
3520 uistream(
const char *,
int = ios::in | ios::binary,
int = filebuf::openprot);
3521 void open(
const char *,
int = ios::in | ios::binary,
int = filebuf::openprot);
3523 #if (__BORLANDC__ >= 0x0540)
3524 uistream(
const char *,
int = ios::in | ios::binary,
int protection = 666);
3525 void open(
const char *,
int = ios::in | ios::binary,
int protection = 666);
3527 #if defined (_MSC_VER) || defined (__WAT32__)
3528 #if (_MSC_VER < 1300)
3529 uistream(
const char *,
int = ios::in | ios::binary,
int = filebuf::openprot);
3530 void open(
const char *,
int = ios::in | ios::binary,
int = filebuf::openprot);
3532 uistream(
const char *,
int = ios::in | ios::binary,
int prot = 0664);
3533 void open(
const char *,
int = ios::in | ios::binary,
int prot = 0664);
3537 uistream(
const char *,
int = ios::in,
int = filebuf::openprot);
3538 void open(
const char *,
int = ios::in,
int = filebuf::openprot);
3542 uistream(
const char *,
int = ios::in,
int = filebuf::openprot);
3543 void open(
const char *,
int = ios::in,
int = filebuf::openprot);
3551 #if !defined(_MSC_VER)
3552 #if defined(__ADSGI__)
3553 uistream(
const char *name,
int mode = ios::in,
int prot = 0664);
3554 void open(
const char *name,
int mode = ios::in,
int prot = 0664);
3556 uistream(
const char *name,
int mode = ios::in | ios::binary,
3558 void open(
const char *name,
int mode = ios::in | ios::binary,
3565 uistream &
get(
signed char *, int,
char =
'\n');
3567 uistream &
get(
unsigned char *, int,
char =
'\n');
3598 #if defined(__TURBOC__) || defined (_MSC_VER)
3735 return (
shape == NULL);
3742 d3_array(
int sl,
int sh,
int nrl,
int nrh,
int ncl,
int nch);
3743 d3_array(
int sl,
int sh,
int nrl,
int nrh);
3750 d3_array(
int sl,
int sh,
int nrl,
int nrh,
const ivector & ncl,
int nch);
3763 int ncl,
const imatrix & nch);
3765 int ncl,
const imatrix & nch);
3771 int ncl,
const ivector & nch);
3779 void allocate(
int sl,
int sh,
int nrl,
int nrh,
int ncl,
int nch);
3780 void allocate(
int sl,
int sh,
int nrl,
int nrh);
3785 void allocate(
int sl,
int sh,
int nrl,
int nrh,
const ivector& ncl,
int nch);
3791 int ncl,
const imatrix & nch);
3794 void allocate(
int sl,
int sh,
const ivector& nrl,
int nrh,
int ncl,
int nch);
3795 void allocate(
int sl,
int sh,
int nrl,
const ivector& nrh,
int ncl,
int nch);
3802 void allocate(
int sl,
int sh,
int nrl,
int nrh,
int ncl,
3807 int ncl,
const ivector & nch);
3882 const double &
operator() (
int k,
int i,
int j)
const;
3908 return ((
t[k].m[i]).v)[j];
3924 return ((
t[k].m[i]).v)[j];
3949 # if defined(MFCL2_CONSTRUCTORS)
3955 return (
shape == NULL);
3966 i3_array(
int sl,
int sh,
int nrl,
int nrh,
int ncl,
int nch);
3967 i3_array(
int sl,
int sh,
int nrl,
int nrh,
const ivector & ncl,
int nch);
3972 int ncl,
const imatrix & nch);
3979 i3_array(
int sl,
int sh,
int nrl,
const ivector & nrh,
int ncl,
int nch);
3985 void allocate(
int sl,
int sh,
int nrl,
const ivector& nrh,
int ncl,
int nch);
3988 void allocate(
int sl,
int sh,
int nrl,
int nrh,
int ncl,
int nch);
3991 void allocate(
int sl,
int sh,
int nrl,
int nrh,
const ivector& ncl,
int nch);
4001 int ncl,
const imatrix & nch);
4011 int ncl,
const ivector & nch);
4014 void allocate(
int sl,
int sh,
int nrl,
int nrh,
int ncl,
const ivector& nch);
4076 const int&
operator()(
int i,
int j,
int k)
const;
4095 cerr <<
"matrix bound exceeded -- row index too low in"
4096 <<
"ivector& i3_array::elem(int).\n";
4101 cerr <<
"matrix bound exceeded -- row index too high in"
4102 <<
"ivector& i3_array::elem(int).\n";
4111 cerr <<
"matrix bound exceeded -- row index too low in"
4112 <<
"ivector& i3_array::elem(int).\n";
4117 cerr <<
"matrix bound exceeded -- row index too high in"
4118 <<
"ivector& i3_array::elem(int).\n";
4150 return ((
t[i].m[j]).v)[k];
4152 return elem(i)(j, k);
4182 return ((
t[i].m[j]).v)[k];
4184 return elem(i)(j, k);
4188 # if defined(__NUMBERVECTOR__)
4208 return (
shape == NULL);
4213 void allocate(
int sl,
int sh,
int nrl,
int nrh,
int ncl,
int nch);
4214 void allocate(
int sl,
int sh,
int nrl,
int nrh);
4218 void allocate(
int sl,
int sh,
int nrl,
int nrh,
const ivector& ncl,
int nch);
4222 void allocate(
int sl,
int sh,
int nrl,
int nrh,
4233 int ncl,
const ivector & nch);
4234 void allocate(
int sl,
int sh,
int nrl,
int nrh,
4235 int ncl,
const ivector & nch);
4243 dvar3_array(
int sl,
int sh,
int nrl,
int nrh,
int ncl,
int nch);
4258 # if defined(__NUMBERVECTOR__)
4345 return (((
t[k].m[i]).va) + j);
4365 return (((
t[k].m[i]).va) + j);
4422 double cumd_norm(
const double &x,
double);
4568 double cube(
double x);
4585 double fmin,
double fmax,
const dvariable & fpen,
double s);
4589 double fmin,
double fmax,
double s);
4593 double fmin,
double fmax,
const dvariable & fpen,
double s);
4597 double fmin,
double fmax,
double s);
4604 double fmin,
double fmax);
4606 double fmin,
double fmax);
4612 const int &_ii,
double fmin,
double fmax,
double s);
4615 double fmin,
double fmax,
double s);
4618 double fmin,
double fmax);
4624 double fmin,
double fmax);
4626 double fmin,
double fmax);
4629 double fmin,
double fmax);
4632 double fmin,
double fmax);
4639 const int &_ii,
double fmin,
double fmax,
const dvariable & fpen,
double s);
4641 double fmin,
double fmax,
const dvariable & fpen,
double s);
4658 int n,
double fmin,
double fmax);
4662 const int &ii,
int n);
4667 const int &ii,
int n);
4669 const int &ii,
int n,
double fmin,
double fmax);
4672 const int &ii,
int n);
4674 const int &ii,
int n,
double fmin,
double fmax,
const dvariable & fpen);
4676 const int &ii,
int n);
4741 const int &i,
int &j);
4764 const double &ln_unsigned_det,
double &
sign);
4788 double posfun(
const double &x,
const double eps,
const double &_pen);
4789 double posfun2(
const double &x,
const double eps,
const double &_pen);
4790 double dfposfun(
const double &x,
const double eps);
4804 double log_comb(
double n,
double k);
5046 double yp1 = 0.0,
double ypn = 0.0);
5067 double yp1 = 0.0,
double ypn = 0.0);
5073 void *cdecl _farptr_norm(
void *);
5074 void *cdecl _farptr_fromlong(
unsigned long int);
5169 void allocate(
int hsl,
int hsu,
int sl,
int sh,
int nrl,
int nrh,
int ncl,
5175 void allocate(
int hsl,
int hsu,
int sl,
int sh,
int nrl,
5180 const imatrix & nrh,
int ncl,
int nch);
5187 return (
shape == NULL);
5214 d4_array(
int,
int,
int,
int,
int,
int,
int,
int);
5217 const imatrix & nrh,
int ncl,
int nch);
5226 return ((*
this) (i)) (j);
5230 return (((*
this) (i, j)) (k));
5232 double &
elem(
int i,
int j,
int k,
int l)
5234 return (((*
this) (i, j, k)) (l));
5242 return ((*
this) (i)) (j);
5246 return (((*
this) (i, j)) (k));
5248 const double &
elem(
int i,
int j,
int k,
int l)
const
5250 return (((*
this) (i, j, k)) (l));
5256 const double&
operator()(
int i,
int j,
int k,
int l)
const;
5391 return ((*
this)(i))(j);
5395 return ((*
this)(i, j))(k);
5399 return ((*
this)(i, j, k))(l);
5411 return ((*
this)(i))(j);
5415 return ((*
this)(i, j))(k);
5419 return ((*
this)(i, j, k))(l);
5441 void allocate(
int hsl,
int hsu,
int sl,
int sh,
int nrl,
int nrh,
int ncl,
5443 void allocate(
int hsl,
int hsu,
int sl,
int sh,
int nrl,
int nrh,
5460 return (
shape == NULL);
5466 dvar4_array(
int,
int,
int,
int,
int,
int,
int,
int);
5473 const imatrix & nrh,
int ncl,
int nch);
5475 const imatrix & nrh,
int ncl,
int nch);
5485 return ((*
this) (i)) (j);
5489 return (((*
this) (i, j)) (k));
5493 return (((*
this) (i, j, k)) (l));
5501 return ((*
this) (i)) (j);
5505 return (((*
this) (i, j)) (k));
5509 return (((*
this) (i, j, k)) (l));
5526 return ((*
this) (i)) (j);
5530 return (((*
this) (i, j)) (k));
5534 return (((*
this) (i, j, k)) (l));
5546 return ((*
this) (i)) (j);
5550 return (((*
this) (i, j)) (k));
5554 return (((*
this) (i, j, k)) (l));
5755 fmmt(
int _nvar,
int _m = 7);
5774 void allocate(
int hsl,
int hsu,
int sl,
int sh,
int nrl,
int nrh,
int ncl,
5789 return (
shape == NULL);
5807 i4_array(
int,
int,
int,
int,
int,
int,
int,
int);
5810 int nrl,
const imatrix & nrh,
int ncl,
int nch);
5823 return elem(i)(j, k);
5825 int&
elem(
int i,
int j,
int k,
int l)
5827 return elem(i)(j, k, l);
5839 const int&
operator()(
int i,
int j,
int k,
int l)
const;
5963 cerr <<
"Index out of bounds in "
5964 <<
"i4_array::elem(int).\n";
5973 cerr <<
"Index out of bounds in "
5974 <<
"i4_array::elem(int).\n";
6008 return elem(i)(j, k);
6014 return t[i](j, k, a);
6016 return elem(i)(j, k, a);
6048 return elem(i)(j, k);
6054 return t[i](j, k, a);
6056 return elem(i)(j, k, a);
6074 void allocate(
int hhsl,
int hhsu,
int hsl,
int hsu,
int sl,
int sh,
int nrl,
6075 int nrh,
int ncl,
int nch);
6089 return (
shape == NULL);
6106 i5_array(
int,
int,
int,
int,
int,
int,
int,
int);
6109 int nrl,
const imatrix & nrh,
int ncl,
int nch);
6127 const int&
operator()(
int,
int,
int,
int,
int)
const;
6253 cerr <<
"Index out of bounds in i5_array::elem(int).\n";
6264 cerr <<
"Index out of bounds in i5_array::elem(int).\n";
6289 return t[i](j, k, l);
6293 return t[i](j, k, l, m);
6313 return t[i](j, k, l);
6317 return t[i](j, k, l, m);
6336 d5_array(
int hhsl,
int hhsu,
int hsl,
int hsu,
int sl,
int sh,
int nrl,
6337 int nrh,
int ncl,
int nch);
6338 void allocate(
int hhsl,
int hhsu,
int hsl,
int hsu,
int sl,
int sh,
6339 int nrl,
int nrh,
int ncl,
int nch);
6364 return (
shape == NULL);
6377 return ((*
this) (i)) (j);
6381 return (((*
this) (i, j)) (k));
6385 return (((*
this) (i, j, k)) (l));
6387 double &
elem(
int i,
int j,
int k,
int l,
int _m)
6389 return (((*
this) (i)) (j, k, l, _m));
6397 return ((*
this) (i)) (j);
6401 return (((*
this) (i, j)) (k));
6405 return (((*
this) (i, j, k)) (l));
6407 const double &
elem(
int i,
int j,
int k,
int l,
int _m)
const
6409 return (((*
this) (i)) (j, k, l, _m));
6422 return ((*
this) (i)) (j);
6426 return (((*
this) (i, j)) (k));
6430 return (((*
this) (i)) (j, k, l));
6434 return (((*
this) (i)) (j, k, l, _m));
6446 return ((*
this) (i)) (j);
6450 return (((*
this) (i)) (j, k));
6454 return (((*
this) (i)) (j, k, l));
6456 inline const double &
operator () (
int i,
int j,
int k,
int l,
int _m)
const
6458 return (((*
this) (i)) (j, k, l, _m));
6466 const double &
operator() (
int i,
int j,
int k,
int l,
int _m)
const;
6507 dvar5_array(
int hhsl,
int hhsu,
int hsl,
int hsu,
int sl,
int sh,
6508 int nrl,
int nrh,
int ncl,
int nch);
6513 void allocate(
int hhsl,
int hhsu,
int hsl,
int hsu,
int sl,
int sh,
6514 int nrl,
int nrh,
int ncl,
int nch);
6536 return (
shape == NULL);
6547 return ((*
this) (i)) (j);
6551 return (((*
this) (i, j)) (k));
6555 return (((*
this) (i, j, k)) (l));
6559 return (((*
this) (i)) (j, k, l, _m));
6567 return ((*
this) (i)) (j);
6571 return (((*
this) (i, j)) (k));
6575 return (((*
this) (i, j, k)) (l));
6579 return (((*
this) (i)) (j, k, l, _m));
6592 return ((*
this) (i)) (j);
6596 return (((*
this) (i, j)) (k));
6600 return (((*
this) (i)) (j, k, l));
6604 return (((*
this) (i)) (j, k, l, _m));
6616 return ((*
this) (i)) (j);
6620 return (((*
this) (i)) (j, k));
6624 return (((*
this) (i)) (j, k, l));
6629 return (((*
this) (i)) (j, k, l, _m));
6679 d6_array(
int hhsl,
int hhsu,
int hsl,
int hsu,
int sl,
int sh,
int nrl,
6680 int nrh,
int ncl,
int nch,
int l6,
int u6);
6681 void allocate(
int hhsl,
int hhsu,
int hsl,
int hsu,
int sl,
int sh,
6682 int nrl,
int nrh,
int ncl,
int nch,
int l6,
int u6);
6705 return (
shape == NULL);
6719 return elem(i)(j, k);
6723 return elem(i)(j, k, l);
6727 return elem(i)(j, k, l, _m);
6729 double &
elem(
int i,
int j,
int k,
int l,
int _m,
int _n)
6731 return elem(i)(j, k, l, _m, _n);
6740 return elem(i)(j, k);
6744 return elem(i)(j, k, l);
6748 return elem(i)(j, k, l, _m);
6750 const double&
elem(
int i,
int j,
int k,
int l,
int _m,
int _n)
const
6752 return elem(i)(j, k, l, _m, _n);
6768 return elem(i)(j, k);
6772 return elem(i)(j, k, l);
6776 return elem(i)(j, k, l, _m);
6780 return elem(i)(j, k, l, _m, _n);
6796 return elem(i)(j, k);
6800 return elem(i)(j, k, l);
6804 return elem(i)(j, k, l, _m);
6806 inline const double&
operator()(
int i,
int j,
int k,
int l,
int _m,
int _n)
6809 return elem(i)(j, k, l, _m, _n);
6833 cerr <<
"Error: Index is out of bounds in"
6834 <<
" d5_array& d6_array::elem(int).\n";
6846 cerr <<
"Error: Index is out of bounds in"
6847 <<
" d5_array& d6_array::elem(int).\n";
6869 dvar6_array(
int hhsl,
int hhsu,
int hsl,
int hsu,
int sl,
int sh,
6870 int nrl,
int nrh,
int ncl,
int nch,
int l6,
int u6);
6871 void allocate(
int hhsl,
int hhsu,
int hsl,
int hsu,
int sl,
int sh,
6872 int nrl,
int nrh,
int ncl,
int nch,
int l6,
int u6);
6894 return (
shape == NULL);
6909 return ((*
this) (i)) (j);
6913 return (((*
this) (i, j)) (k));
6917 return (((*
this) (i, j, k)) (l));
6921 return (((*
this) (i)) (j, k, l, _m));
6925 return (((*
this) (i)) (j, k, l, _m, _n));
6933 return ((*
this) (i)) (j);
6937 return (((*
this) (i, j)) (k));
6941 return (((*
this) (i, j, k)) (l));
6945 return (((*
this) (i)) (j, k, l, _m));
6949 return (((*
this) (i)) (j, k, l, _m, _n));
6962 return ((*
this) (i)) (j);
6966 return (((*
this) (i, j)) (k));
6970 return (((*
this) (i)) (j, k, l));
6974 return (((*
this) (i)) (j, k, l, _m));
6978 return (((*
this) (i)) (j, k, l, _m, _n));
6990 return ((*
this) (i)) (j);
6994 return (((*
this) (i)) (j, k));
6998 return (((*
this) (i)) (j, k, l));
7003 return (((*
this) (i)) (j, k, l, _m));
7008 return (((*
this) (i)) (j, k, l, _m, _n));
7060 d7_array(
int l7,
int u7,
int hhsl,
int hhsu,
int hsl,
int hsu,
int sl,
7061 int sh,
int nrl,
int nrh,
int ncl,
int nch,
int l6,
int u6);
7062 void allocate(
int l7,
int u7,
int hhsl,
int hhsu,
int hsl,
int hsu,
7063 int sl,
int sh,
int nrl,
int nrh,
int ncl,
int nch,
int l6,
int u6);
7087 return (
shape == NULL);
7103 return elem(i)(j, k);
7107 return elem(i)(j, k, l);
7111 return elem(i)(j, k, l, _m);
7115 return elem(i)(j, k, l, _m, _n);
7117 double&
elem(
int i,
int j,
int k,
int l,
int _m,
int _n,
int _p)
7119 return elem(i)(j, k, l, _m, _n, _p);
7128 return elem(i)(j, k);
7132 return elem(i)(j, k, l);
7136 return elem(i)(j, k, l, _m);
7140 return elem(i)(j, k, l, _m, _n);
7142 const double&
elem(
int i,
int j,
int k,
int l,
int _m,
int _n,
int _p)
const
7144 return elem(i)(j, k, l, _m, _n, _p);
7160 return elem(i, j)(k);
7164 return elem(i)(j, k, l);
7168 return elem(i)(j, k, l, _m);
7172 return elem(i)(j, k, l, _m, _n);
7174 double&
operator()(
int i,
int j,
int k,
int l,
int _m,
int _n,
int _p)
7176 return elem(i)(j, k, l, _m, _n, _p);
7192 return elem(i)(j, k);
7196 return elem(i)(j, k, l);
7200 return elem(i)(j, k, l, _m);
7205 return elem(i)(j, k, l, _m, _n);
7207 inline const double&
operator()(
int i,
int j,
int k,
int l,
int _m,
int _n,
7210 return elem(i)(j, k, l, _m, _n, _p);
7236 cerr <<
"Error index out of bounds in\n"
7237 "d5_array& d7_array::elem(int)" <<
endl;
7248 cerr <<
"Error index out of bounds in\n"
7249 "d5_array& d7_array::elem(int)" <<
endl;
7267 dvar7_array(
int hhsl,
int hhsu,
int hsl,
int hsu,
int sl,
int sh,
7268 int nrl,
int nrh,
int ncl,
int nch,
int l6,
int u6,
int l7,
int u7);
7270 void allocate(
int hhsl,
int hhsu,
int hsl,
int hsu,
int sl,
int sh,
7271 int nrl,
int nrh,
int ncl,
int nch,
int l6,
int u6,
int l7,
int u7);
7295 return (
shape == NULL);
7311 return ((*
this) (i)) (j);
7315 return (((*
this) (i, j)) (k));
7319 return (((*
this) (i, j, k)) (l));
7323 return (((*
this) (i)) (j, k, l, _m));
7327 return (((*
this) (i)) (j, k, l, _m, _n));
7331 return (((*
this) (i)) (j, k, l, _m, _n, _p));
7339 return ((*
this) (i)) (j);
7343 return (((*
this) (i, j)) (k));
7347 return (((*
this) (i, j, k)) (l));
7351 return (((*
this) (i)) (j, k, l, _m));
7355 return (((*
this) (i)) (j, k, l, _m, _n));
7360 return (((*
this) (i)) (j, k, l, _m, _n, _p));
7373 return ((*
this) (i)) (j);
7377 return (((*
this) (i, j)) (k));
7381 return (((*
this) (i)) (j, k, l));
7385 return (((*
this) (i)) (j, k, l, _m));
7389 return (((*
this) (i)) (j, k, l, _m, _n));
7393 return (((*
this) (i)) (j, k, l, _m, _n, _p));
7405 return ((*
this) (i)) (j);
7409 return (((*
this) (i)) (j, k));
7413 return (((*
this) (i)) (j, k, l));
7418 return (((*
this) (i)) (j, k, l, _m));
7423 return (((*
this) (i)) (j, k, l, _m, _n));
7426 int _n,
int _p)
const
7428 return (((*
this) (i)) (j, k, l, _m, _n, _p));
7510 return (
shape == NULL);
7538 void allocate(
int nrl,
int nrh,
int ncl,
int nch);
7553 return (*((*(
m + i)).v + j));
7572 return (*((*(
m + i)).v + j));
7611 void write_on(
const ostream &)
const;
7660 operator int()
const
7704 virtual operator int()
7706 cerr <<
"Error in index_type"
7707 " -- object not dereferenced enough" <<
endl;
7801 virtual operator int()
7897 return new i3_index(i4_array::operator[](i));
8029 #if defined(OPT_LIB)
8032 return (*((
d.
m[i - j]).v + i));
8040 return (*((
d.
m[i - j]).v + i));
8049 const double &
operator() (
int i,
int j)
const;
8097 #if defined(OPT_LIB)
8100 return ((
d.
m[i - j]).va + i);
8159 #if defined(OPT_LIB)
8162 return (*((
d.
m[i - j]).v + i));
8170 return (*((
d.
m[i - j]).v + i));
8179 const double &
operator() (
int i,
int j)
const;
8223 #if defined(OPT_LIB)
8226 return ((
d.
m[i - j]).va + i);
8234 return ((
d.
m[i - j]).va + i);
8248 return *(
double *) ((
d.
m[i - j]).va + i);
8252 return *(
double *) ((
d.
m[i - j]).va + i);
8302 unsigned long max(
unsigned long u,
unsigned long v);
8303 unsigned long min(
unsigned long u,
unsigned long v);
8304 double max(
const double u,
const double v);
8305 double min(
const double u,
const double v);
8306 int max(
int i,
int j,
int k);
8307 int max(
int i,
int j);
8319 int admax(
int i,
int j);
8327 double gammln(
double xx);
8440 double betacf(
const double a,
const double b,
double x,
int maxit = 100);
8444 double betai(
const double a,
const double b,
const double x,
int maxit=100);
8446 double pbeta(
const double x,
const double a,
const double b,
int maxit=100);
8453 double besselI(
double x,
int nu);
8454 double besselK(
double x,
int nu);
8455 double besselJ(
double x,
int nu);
8456 double besselY(
double x,
int nu);
8476 class double_number_index;
8477 class double_vector_index;
8478 class double_matrix_index;
8479 class double_i3_index;
8506 operator double ()
const
8545 virtual operator double ()
8547 cerr <<
"Error in double_index_type"
8548 " -- object not dereferenced enough" <<
endl;
8625 virtual operator double ()
8793 #define AD_SET_DERIVATIVES1(depvar,indvar,df) \
8794 gradient_structure::GRAD_STACK1->set_gradient_stack2(default_evaluation2,\
8795 &(value(depvar)), &(value(indvar)),df);
8797 #define AD_SET_DERIVATIVES2(depvar,indvar1,df1,indvar2,df2) \
8798 gradient_structure::GRAD_STACK1->set_gradient_stack(default_evaluation3,\
8799 &(value(depvar)), &(value(indvar1)),df1,&(value(indvar2)),df2);
8801 #define AD_SET_DERIVATIVES3(depvar,indvar1,df1,indvar2,df2,indvar3,df3) \
8802 gradient_structure::GRAD_STACK1->set_gradient_stack(default_evaluation3ind,\
8803 &(value(depvar)), &(value(indvar1)),df1,&(value(indvar2)),df2, \
8804 &(value(indvar3)),df3);
8806 #define AD_SET_DERIVATIVES4(depvar,indvar1,df1,indvar2,df2,indvar3,df3, \
8808 gradient_structure::GRAD_STACK1->set_gradient_stack(default_evaluation4ind,\
8809 &(value(depvar)), &(value(indvar1)),df1,&(value(indvar2)),df2, \
8810 &(value(indvar3)),df3, \
8811 &(value(indvar4)),df4);
8813 #define ADJOINT_CODE(x) \
8814 gradient_structure::GRAD_STACK1->set_gradient_stack(x);
8819 #if defined(USE_ADPVM)
8820 class adpvm_manager;
8843 static int time_flag;
8847 #if defined(USE_ADPVM)
8853 const streampos & off = 0);
8855 const streampos & off = 0);
8869 int option_match(
int argc,
char *argv[],
const char *
string);
8870 int option_match(
int argc,
char *argv[],
const char *
string,
int& nopt);
8871 int option_match(
char *s,
const char *
string,
int& nopt);
8893 #if !defined(_WIN32)
8894 #include <sys/time.h>
8912 #include <windows.h>
8921 unsigned long long t;
8922 unsigned long long told;
8974 (
const dmatrix & MM,
const int &_ierr);
9010 double bounder(
double x,
double min,
double max,
double scale);
9029 double xmin,
double xmax);
9084 double cumd_pareto(
double _y,
double alpha,
double xm);
9089 double spread = 3.0);
9114 double eps = 1.e-7);
9120 double qbeta(
double x,
double a,
double b,
double eps = 0);
9124 double bound = 0.999999);
9126 double norm_to_gamma(
double v,
double alpha,
double bound = 0.999999);
9139 double beta_deviate(
double x,
double a,
double b,
double eps = 1.e-7);
9149 ivector & marker,
int *flag__);
9161 int enddeg,
int nconst_end);
9163 # include <ddfvar.hpp>
9164 # include <qdfvar.hpp>
9168 void test_the_pointer(
void);
9177 double logistic(
double a,
double b,
const double &x);
9178 double dflogistic(
double a,
double b,
const double &x);
9216 double avg(
double x,
double y);
9321 void allocate(
int mmin,
int mmax,
int n,
int m);
9376 void allocate(
int mmin,
int mmax,
int n,
int m);
9404 typedef struct cs_symbolic
css;
9436 class dvar_hs_smatrix;
9486 template <
class ... Args>
9487 int ad_printf( FILE* stream,
const char* format, Args ... args )
9489 return fprintf(stream, format, args...);
9491 template <
class ... Args>
9494 int result = printf(format, args...);
9510 #endif//#ifndef FVAR_HPP
void allocate(void)
Does NOT allocate, but initializes i5_array members.
void reinitialize(const int seed)
Reinitialize random number seed.
static streampos change_pinfile_name(const adstring &s, const streampos &off=0)
Change the global_parfile stream using input_file.
const double & elem(int i, int j, int k, int l, int _m, int _n) const
double operator()(double)
Description not yet available.
index_guts()
Default constructor.
void save_dmatrix_derivatives(const dvar_matrix_position &) const
Description not yet available.
const dvar_vector & elem(int i, int j, int k, int l, int _m, int _n) const
void allocate(void)
Description not yet available.
void fmin(const double &f, const dvector &x, const dvector &g)
Description not yet available.
void rowfill(int j, const dvector &v)
Fills dmatrix row at index row with values from vec.
void default_evaluation2(void)
Description not yet available.
void set_gradient_stack4(void(*func)(void), double *dep_addr, double *ind_addr1, double *ind_addr2)
Description not yet available.
double restore_prevariable_derivative(const prevariable_position &_pos)
Description not yet available.
void fill_randu(long int &n)
Description not yet available.
Description not yet available.
friend prevariable & sqr(const prevariable &t1)
Returns the square of v1.
~dvar5_array()
Destructor.
fmm(int nvar, int disk_save=0)
Description not yet available.
dvariable operator()(double u)
Description not yet available.
void colfill_seqadd(const int &, double, double)
Fills column of a matrix with a sequence of the form base, base+offset, base+2*offset,...
friend prevariable & tan(const prevariable &t1)
Description not yet available.
grad_stack(const size_t size)
Description not yet available.
dvar_vector & elem(int i, int j, int k, int l, int _m, int _n)
Description not yet available.
Description not yet available.
Base class for dvariable.
friend prevariable & log(const prevariable &t1)
Description not yet available.
friend dmatrix inv(const dmatrix &)
Inverse of a constant matrix by LU decomposition.
void initialize()
Initialize elements in pointer array to null.
d3_array_position(int mmin, int mmax)
Description not yet available.
double factln(double n)
Log-factorial .
double_index_type(double x)
Description not yet available.
dvar_vector operator-()
Description not yet available.
void allocate(void)
Does NOT allocate, but initializes empty d3_array.
double sigmoid(const double v1)
Returns computed sigmoid value at v1.
d3_array tan(const d3_array &arr3)
Returns d3_array results with computed tan from elements in arr3.
d3_array sqr(const d3_array &arr3)
Returns d3_array with square values from arr3.
void set_gradient_stack1(void(*func)(void), double *dep_addr, double *ind_addr1)
Sets the gradient stack entry for a function or operator with a single independent variable...
dvar_vector()
Default constructor.
void fill_multinomial(const int &seed, const dvector &p)
Description not yet available.
ostream & operator<<(grad_stack)
const d3_array & elem(int i, int j, int k) const
const dmatrix & get_dmatrix(void) const
double * ind_addr1
Pointer to first independent variable.
double ghk(const dvector &lower, const dvector &upper, const dmatrix &Sigma, const dmatrix &eps)
Description not yet available.
dvar5_array & operator[](int i)
void myheapcheck(char *msg)
Does nothing.
double & operator()(int i, int j)
dvector log10(const dvector &vec)
Returns dvector with the common (base-10) logarithm of vec.
Description not yet available.
void * restore_ad_pointer(void)
Description not yet available.
void initialize()
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
void open(const char *name, int mode=ios::in|ios::binary, int prot=0664)
Description not yet available.
imatrix & get_coords(void)
Description not yet available.
double * v
pointer to the data
dmatrix fillout(const lower_triangular_dmatrix &M)
Description not yet available.
void rowfill_randu_ni(const int &i, long int &n)
Description not yet available.
double log_comb(double n, double k)
Log of the binomial coefficent; i.e log of 'n choose k'.
d4_array & operator()(int i, int j)
void save(void)
Save values to file.
double restore_prevariable_value(void)
static adpvm_manager * pvm_manager
i4_array & operator()(int)
dvar_matrix & operator-=(const dvar_matrix &x)
Description not yet available.
double get_elapsed_time(void)
Returns the elapsed time in milliseconds from the timer object.
Description not yet available.
void fill_randbi(long int &n, double)
Description not yet available.
pre_zero_print(const dvector &v)
virtual int indexmin(void)=0
dvector atan2(const dvector &t1, const dvector &t2)
d3_array elem_prod(const d3_array &a, const d3_array &b)
Returns d3_array results with computed elements product of a(i, j, k) * b(i, j, k).
const d5_array & operator()(int i, int j) const
int operator!(void) const
virtual int indexmax(void)
void fill_randu_ni(long int &n)
void fmmdisp(const dvector &x, const dvector &g, const int &nvar, int scroll_flag, int noprintx)
Description not yet available.
void shallow_copy(const i5_array &)
Shallow copy other data structure pointers.
void set_gbuffer_pointers(void)
Description not yet available.
virtual index_guts * operator[](int i)
double_and_int * arr_new(unsigned int sz)
void save_dvar_matrix_value() const
Saves the size, address, and value information for a dvar_matrix.
void ludcmp_index(const dmatrix &_a, const ivector &_indx, const double &_d)
LU decomposition.
double inv_cumd_t(double n, double u, double eps)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
vector_index(const ivector &v)
Constructor for ivector.
double right_bracket_value
void fill_randcau(const random_number_generator &rng)
Description not yet available.
Description not yet available.
dvar4_array & operator=(const d4_array &)
Description not yet available.
double * get_address(const int &i)
dvector lower_triangular_solve(const dmatrix &m, const dvector &v)
Description not yet available.
void ludcmp(const dmatrix &a, const ivector &indx, const double &d)
Lu decomposition of a constant matrix.
void initialize(void)
Description not yet available.
void write_on(const ostream &s) const
Description not yet available.
virtual index_guts * operator[](int i)
void deallocate(void)
Deallocate dvar6_array memory.
i3_array & operator=(const i3_array &other)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
dvar_vector & elem(int i)
friend void df_check_derivative_values_indexed(void)
Description not yet available.
dvar_matrix & operator--(void)
d4_array & elem(int i, int j, int k)
Uses polymorphism to get index information from various data types to be used in constructing and all...
lvector(void)
Default constructor.
double operator()(double u)
dvar_vector_position operator()(int i)
Description not yet available.
int operator!=(double v0, const prevariable &v1)
Description not yet available.
dvar_vector get_eigen_values(const dvar_vector &_ddd, const dvar_vector &_eee)
Eigenvalues and eigenvectors.
dvector & operator()(int i)
Description not yet available.
Description not yet available.
void check_list(void)
Check link list integrity.
virtual int dimension() const
Description not yet available.
double mult2
Second mutiplicand in chain rule multipication.
dvar3_array & elem(int i, int j)
const dvector & operator()(int i, int j, int k, int l, int _m, int _n) const
unsigned int get_ncopies() const
prevariable operator()(int i, int j) const
friend prevariable & sigmoid(const prevariable &t1)
Description not yet available.
void operator/=(double d)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
void jacobcalc(int nvar, const dmatrix &jac)
Description not yet available.
Description not yet available.
void read_from(const istream &)
Read values to dvar_matrix from input istream s.
void derch(const double &_f, const dvector &_x, const dvector &_gg, int n, const int &_ireturn)
Description not yet available.
void write_on(const ostream &) const
Description not yet available.
virtual double_index_guts * operator[](int i)
Description not yet available.
pre_column_print column_print(const dvector &v)
Description not yet available.
const d3_array & elem(int i) const
Description not yet available.
const double & operator()(int i, int j, int k, int l, int _m, int _n, int _p) const
banded_lower_triangular_dmatrix restore_banded_lower_triangular_dvar_matrix_derivatives(const dvar_matrix_position &_pos)
Description not yet available.
friend dvariable det(const dvar_matrix &)
Determinaant of matrix.
Description not yet available.
Description not yet available.
double inv_cumd_exponential(double y)
Description not yet available.
const double & elem(int i, int j, int k, int l, int _m) const
const AD_LONG_INT & elem(int i) const
Description not yet available.
Description not yet available.
const d6_array & operator[](int i) const
int sub_unallocated(const dvar_vector &)
Author: David Fournier Copyright (c) 2008-2017 Regents of the University of California.
i5_array()
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
double ghk_choleski(const dvector &lower, const dvector &upper, const dmatrix &ch, const dmatrix &eps)
void *& operator[](int i)
Description not yet available.
grad_stack_entry * true_ptr_first
dvariable robust_regression_fixed(const dvector &obs, const dvar_vector &pred, double a=0.7)
int Max(const ivector &t1)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
const dvector & elem(int i, int j, int k, int l, int _m) const
d6_array()
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
d5_array & operator[](int i)
int count_factor(const dvector &v, const double &eps)
Description not yet available.
d3_array & elem(int i, int j)
friend prevariable & operator-(const prevariable &v1)
Description not yet available.
unsigned int get_ncopies() const
const d6_array & operator()(int i) const
dmatrix row_vector(const dvector &v)
Returns dvar_matrix with a single row using values from v.
void set_value_exp(const prevariable &_x, const dvar_vector &v, const int &_ii, double fmin, double fmax, const dvariable &fpen, double s)
int size_count_partial(const dvector &x, int n)
Description not yet available.
~fmmc()
Description not yet available.
friend d3_array value(const dvar3_array &ar)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
void send_dv3_to_master(const dvar3_array &v)
void allocatec(const dvar_vector &)
Description not yet available.
unsigned int get_ncopies() const
static vector_shape_pool * xpool
dvar_vector & shift(int min)
Description not yet available.
Description not yet available.
ivector & elem(int i, int j, int k)
dvector inv_cumd_pareto(const dvector &_y, double alpha, double xm)
void allocate(int mmin, int mmax, int n, int m)
dvar_vector & operator/=(const prevariable &d)
Description not yet available.
virtual int dimension() const
void fill_randn(long int &n)
Description not yet available.
void fmin(const double &f, const dvector &x, const dvector &g)
virtual int indexmin() const
dvector restore_dvar_matrix_derivative_column(const dvar_matrix_position &_pos, const int &ii)
Description not yet available.
void fill_randn_ni(long int &n)
Description not yet available.
virtual int indexmin() const
dvar_vector pareto_density(const dvar_vector &_y, const prevariable &alpha, const prevariable &xm)
double fill_seqadd(double, double)
Description not yet available.
pre_column_print(const dvector &v)
void operator/=(double d)
Divide each element of d3_array by d.
void default_evaluation3(void)
Description not yet available.
static ofstream * global_logfile
double norm_to_gamma(double v, double alpha, double bound)
Description not yet available.
uistream & ignore(int=1, int=EOF)
friend banded_symmetric_dmatrix value(const banded_symmetric_dvar_matrix &v)
Description not yet available.
independent_variables & operator=(const independent_variables &other)
void fill_randn(const random_number_generator &rng)
Description not yet available.
void allocate(void)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
void initialize(void)
Description not yet available.
double & operator[](int i)
void arr_remove(arr_link **pptr)
Remove and delete arr_link node pptr from gradient_structure::ARR_LIST1.
double restore_prevariable_derivative(void)
void shallow_copy(const dvar7_array &)
Shallow copy other data structure pointers.
double gammln(double xx)
Log gamma function.
double & operator()(int i, int j)
const prevariable elem(int i, int j, int k, int l, int _m, int _n) const
void colfill_randn(const int &j, long int &n)
Description not yet available.
void operator/=(const prevariable &d)
Description not yet available.
Derived class of index types for i3_array.
double & elem_value(int i, int j)
unsigned int size() const
Description not yet available.
double & elem_value(int i)
Description not yet available.
void deallocate()
Deallocate dmatrix memory.
dvector tanh(const dvector &vec)
Returns dvector with hyperbolic tangent for each value of vec.
void ADMB_getcallindex(int)
friend dvariable sumsq(const banded_symmetric_dvar_matrix &B)
prevariable elem(int i, int j, int k, int l, int _m)
friend void slave_gradcalc(void)
Description not yet available.
int operator!(void) const
void RETURN_ARRAYS_DECREMENT(void)
Decrements gradient_structure::RETURN_ARRAYS_PTR.
double minimize(const dvector &x, double(*pf)(const dvar_vector &))
imatrix & get_coords(void)
friend class dvar_vector_iterator
double & operator()(int i, int j, int k, int l, int _m, int _n, int _p)
dvar_vector & operator[](int)
virtual index_guts * operator[](int i)
void writeon(const ostream &s) const
writeon Writes function minimizing status
void operator/=(const prevariable &v1)
Description not yet available.
double dfposfun(const double &x, const double eps)
Adjoint code for posfun; possibly not used.
void save_dmatrix_derivatives(const dvar_matrix_position &) const
Description not yet available.
dmatrix & elem(int i, int j)
dvector diagonal(const dmatrix &matrix)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
friend prevariable & sqrt(const prevariable &t1)
Description not yet available.
bool operator!() const
Returns true if dmatrix is empty, else false.
fmmt(int _nvar, int _m=7)
void operator/=(double d)
Divides all elements of d5_array by d.
lvector_position operator()(int i)
int operator!(void) const
friend void slave_gradcalc(void)
friend dvar_vector sigmoid(const dvar_vector &t1)
i4_array & operator=(const i4_array &)
void fmin(const double &f, const dvector &x, const dvector &g)
Description not yet available.
int operator!(void) const
double besselY(double x, int nu)
const dvector & elem(int i) const
dmatrix restore_dvar_matrix_der_nozero(const dvar_matrix_position &_pos)
Description not yet available.
dvector atlas_solve_spd(const dmatrix &M, const dvector &x)
virtual int indexmax() const
const dvar_matrix & elem(int i) const
? Retrieves an element of a dvar3_array.
const d3_array & operator()(int i) const
void dfinvpret(void)
Adjoint code for dvar_matrix inv(const dvar_matrix& aa).
friend void make_indvar_list(const dvar_vector &)
Description not yet available.
double sumsq(const d3_array &a)
i4_array & operator[](int)
int operator!(void) const
dvar_matrix_position(const dvar_matrix &, int)
Description not yet available.
int ad_chdir(const char *s)
Description not yet available.
dvar_matrix positive_definite_matrix(const dvar_matrix &MM, double eps, dvariable &fpen)
Description not yet available.
prevariable operator[](int i)
double_and_int * gradnew()
dmatrix(void)
Default constructor.
friend double norm(const dmatrix &)
Norm of a matrix; constant object.
void grad_chk(void)
Description not yet available.
double pbeta(const double x, const double a, const double b, int maxit)
beta distribution function for constant objects (alias of ibeta function with same arguments order as...
Description not yet available.
d3_array operator-(const d3_array &a, const d3_array &b)
Returns d3_array results with computed elements addition of a(i, j, k) + b(i, j, k).
unsigned int size() const
lower_triangular_dmatrix(int, int)
Description not yet available.
dmatrix & elem(int i, int j, int k, int l)
bool is_valid_row(const int i) const
Check index i is in matrix row bounds [index_min, index_max].
dmatrix trans(const dmatrix &m1)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
dvector eigenvalues(const banded_symmetric_dmatrix &_SS)
Description not yet available.
double bounded_cumd_norm(const double x, double beta)
Description not yet available.
~random_number_generator()
Destructor.
dmatrix expm(const dmatrix &A)
Matrix exponential.
friend prevariable & ldexp(const prevariable &, const int &)
Description not yet available.
const d4_array & elem(int i, int j) const
independent_variables()
Default Constructor.
double_and_int * get_v() const
~double_index_type()
Description not yet available.
int allocated(const ivector &v)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
void fill(const char *)
Fill variable vector from values in string s.
Vector of double precision numbers.
double inv_cumd_gamma(double y, double a)
three_array_shape * shape
Description not yet available.
prevariable operator[](int i)
constexpr const int percentage_number
int indexmin() const
Get minimum valid index.
void colshift(int min)
Changes the range of valid indices for the rows.
friend ostream & operator<<(const ostream &, const pre_zero_print &)
Description not yet available.
size_t total_addresses() const
Get total addresses stored.
const dvector & elem(int i, int j, int k, int l, int _m, int _n) const
double & operator()(int i, int j)
banded_lower_triangular_dvar_matrix(int _min, int _max, int _bw)
Description not yet available.
void initialize(void)
Intialize vector values to zero.
virtual int dimension() const
independent_variables & operator=(const dvector &t)
Assignment operator for dvector argument.
void allocate(void)
Does not allocate, but initializes pointers to NULL.
void shift(int min)
Description not yet available.
friend void slave_gradcalc(void)
double left_bracket_value
void shallow_copy(const dvar4_array &)
Shallow copy other data structure pointers.
void colfill_randn_ni(const int &j, long int &n)
Description not yet available.
dvector choleski_solve_neghess_error(dmatrix M, dvector &v, int &ierror)
Description not yet available.
unsigned long get_offset() const
void jacobcalc(int nvar, const dmatrix &g)
Description not yet available.
const dvector & elem(int i, int j, int k) const
unsigned int get_ncopies(void)
friend dvector value(const dvar_vector &v1)
Description not yet available.
Description not yet available.
friend prevariable & atan(const prevariable &t1)
Description not yet available.
~smart_counter()
Destructor.
void clean(ivector &v, int level)
Set elements of ivec to zero starting from level + 1;.
Description not yet available.
friend double det(const dmatrix &)
Compute determinant of a constant matrix.
ad_integer(const int &_d, const adkludge &)
void fmin(const double &f, const dvector &p, const dvector &gg)
Description not yet available.
dmatrix choleski_decomp_neghess_error(const dmatrix &MM, int &ierror)
Description not yet available.
friend dvariable norm2(const banded_symmetric_dvar_matrix &B)
Description not yet available.
double_and_int * get_address()
void initialize(void)
Description not yet available.
double cumd_gamma(double x, double a)
lmatrix_position restore_lmatrix_position(void)
arr_link & operator=(const arr_link &)=delete
dmatrix restore_dvar_matrix_derivatives(const dvar_matrix_position &_pos)
Description not yet available.
void arr_free(double_and_int *)
virtual int indexmax(void)
Description not yet available.
double robust_normal_mixture_deviate(double x, double spread)
Description not yet available.
int restore_int_value(void)
Description not yet available.
const dvar_matrix & elem(int i, int j, int k, int l) const
index_type operator()(int i)
Description not yet available.
void fmin(double f, const independent_variables &x, const dvector &g, const int &n, const dvector &w, const dvector &h, const fmm_control &fmc)
void rowshift(int min)
Description not yet available.
static int no_derivatives
virtual int indexmax() const
double inv_cumd_norm(const double &x)
Description not yet available.
Derived class of index types for ivector.
void set_defaults()
Description not yet available.
dvar_matrix nograd_assign_trans(const dmatrix &m)
Description not yet available.
double_and_int * get_va()
unsigned int get_ncopies() const
friend double_and_int * gradnew()
Creates an entry in the gradient structure linked list.
void fill_randu_ni(long int &n)
Description not yet available.
void initialize(void)
Description not yet available.
double besselJ(double x, int nu)
dvar_vector nograd_assign(dvector tmp)
Description not yet available.
cubic_spline_function(const dvector &_x, const dvector &_y, double yp1=0.0, double ypn=0.0)
void initialize(void)
Zero initialize allocated dvar_matrix, then saves adjoint function and position data.
void save_dvar_matrix_value() const
Description not yet available.
void initialize(void)
Description not yet available.
void dv_init(void)
Description not yet available.
virtual int indexmin(void)
void save_variables()
Save variables to a buffer.
prevariable elem(int i, int j) const
dvar_matrix & operator++(void)
i3_array & operator()(int i)
static unsigned char directory_prefix
const prevariable elem(int i, int j, int k) const
? Retrieves an element of a dvar3_array.
static adstring working_directory_path
double sum(const d3_array &darray)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
int bandwidth(void) const
dvar_matrix & elem(int i, int j, int k)
Description not yet available.
void allocate(void)
Does not allocate, but initializes dvar_vector to empty.
const d5_array & operator[](int i) const
dvar5_array()
Description not yet available.
static uistream * global_bparfile
dvar6_array & operator[](int i)
unsigned int decr_ncopies(void)
const double & operator()(int i, int j) const
dvector & elem(int i, int j, int k)
Holds derivative information for arithmetic operators and math library functions. ...
void gauss_legendre(double x1, double x2, const dvector &_x, const dvector &_w)
Gauss-Legendre quadature.
double qbeta(double x, double a, double b, double eps)
four_array_shape(int hsl, int hsu)
Construct four_array_shape with initial values and setting min and max.
d3_array operator+(const d3_array &a, const d3_array &b)
Returns d3_array results with computed elements addition of a(i, j, k) + b(i, j, k).
dlink * append(dlink *link)
Append link to list.
~dvar6_array()
Destructor.
void fill_randn(long int &n)
Fill matrix with random numbers.
Description not yet available.
void fill_randcau(const random_number_generator &rng)
Description not yet available.
df1_one_variable atan(const df1_one_variable &x)
dvar4_array & elem(int i, int j)
int decrement_current_gradfile_ptr(void)
If there is a previous file set the handle to point to it otherwise return a -1.
d3_array elem_div(const d3_array &a, const d3_array &b)
Returns d3_array results with computed elements division of a(i, j, k) / b(i, j, k).
Description not yet available.
void colfill_seqadd(const int &, const int &, const int &)
fmmc(const int &n)
Description not yet available.
friend prevariable & fabs(const prevariable &t1)
Absolute value.
dcompressed_triplet(int mmin, int mmax, int n, int m)
dvar5_array & elem(int i)
void gauss_hermite(const dvector &_x, const dvector &_w)
Gauss-Hermite quadature.
dvar_matrix_position restore_dvar_matrix_position()
Reads back the size and address information for a dvar_matrix, restores the size, address...
prevariable elem(int i, int j)
unsigned int get_size() const
Description not yet available.
double old_inv_cumd_beta_stable(double a, double b, double y, double eps)
dmatrix_position restore_dmatrix_position()
Description not yet available.
dvar4_array & operator[](int i)
vector_shape_pool & operator=(const vector_shape_pool &)=delete
d3_array sin(const d3_array &arr3)
Returns d3_array results with computed sin from elements in arr3.
void deallocate(void)
Deallocate i3_array memory.
const double & elem(int i, int j, int k, int l) const
Description not yet available.
friend double min(const dvector &)
Returns the minimum value of vector vec.
dvar3_array & elem(int i, int j, int k)
const double & elem(int i, int j) const
const dmatrix & elem(int k) const
lmatrix(void)
Default constructor.
dvariable & operator=(const prevariable &)
Description not yet available.
dvector cosh(const dvector &vec)
Returns dvector with hyperbolic cosine for each value of vec.
void fill_randn_ni(long int &n)
Description not yet available.
void colfill_randn_ni(const int &j, long int &n)
Description not yet available.
dvar3_array & operator()(int i)
void write_grad_stack_buffer()
lmatrix & operator=(const lmatrix &t)
Description not yet available.
char * get_gradfile_name()
Description not yet available.
void allocate(void)
Initializes to NULL.
df1_two_variable fabs(const df1_two_variable &x)
lvector & shift(int min)
Shift current dimensions of lvector using to_indexmin as the new lower index value.
void default_evaluation1m(void)
Description not yet available.
uostream & operator<<(signed char)
double randnegbinomial(double mu, double tau, const random_number_generator &rng)
Description not yet available.
const dvar_matrix & elem(int i, int j) const
int bandwidth(void) const
virtual int indexmin() const
double density_cauchy(const double &x)
Description not yet available.
~dvar_matrix()
Destructor.
lmatrix restore_lmatrix_value(const lmatrix_position &mpos)
void allocate(void)
Allocate dvector without allocating memory.
Keeps track of total number of copies.
Derived class of index types for i4_array.
double * ind_addr2
Pointer to second independent variable.
double & elem_value(int i, int j)
independent_variables(const independent_variables &other)
dmatrix sub(int, int)
Description not yet available.
d6_array & operator[](int i)
ad_comm()
Default constructor.
dmatrix & elem(int i, int j, int k)
dvector row(const dmatrix &matrix, int i)
Returns a copied row for matrix at i.
Description not yet available.
Derived class of index types for ad_integer.
void initialize(void)
Description not yet available.
const dvar4_array & elem(int i, int j, int k) const
unsigned int rowsize() const
Description not yet available.
void fill_randu(long int &n)
Description not yet available.
void allocate(void)
Does NOT allocate, but initializes d6_array members.
virtual ~number_index()
Destructor.
void fill_randu_ni(long int &n)
Description not yet available.
unsigned int hslicesize() const
d3_array cube(const d3_array &m)
Description not yet available.
double dfposfun1(const double &x, const double eps)
Adjoint code for posfun; possibly not used.
const d4_array & operator()(int i, int j, int k) const
char which_library()
Get ADMB library mode.
Null class to allow specialized function overloads.
const double & operator()(int i, int j, int k, int l, int _m, int _n) const
double_index_guts()
Description not yet available.
void fmin(const double &f, const dvector &x, const dvector &g)
Function fmin contains Quasi-Newton function minimizer with inexact line search using Wolfe condition...
virtual ~dmatrix_index()
Destructor.
dlink * last_remove()
If list is not empty, pop and return last node.
const double_index_type * a
friend dvariable sumsq(const dvar_matrix &)
friend double_and_int * gradnew()
Creates an entry in the gradient structure linked list.
dmatrix_index(const dmatrix &v)
function_tweaker(double eps, double mult)
Description not yet available.
void shallow_copy(const i3_array &)
Shallow copy other data structure pointers.
const prevariable elem(int i, int j, int k, int l) const
dvariable kludge_cumd_cauchy(const prevariable &x)
Description not yet available.
dvar_vector posfun(const dvar_vector &x, double eps, const prevariable &pen)
Description not yet available.
d3_array restore_d3_array_value(const d3_array_position &mpos)
Description not yet available.
dmatrix & operator*=(double d)
Multiply value to all elements in dmatrix.
void nograd_assign_row(const dvar_matrix &m, const dvector &v, const int &ii)
Description not yet available.
friend dvar_matrix operator*(const dvar_matrix &m1, const dmatrix &m2)
Description not yet available.
d3_array value(const dvar3_array &)
friend dvar_vector elem_prod(const dvar_vector &, const dvar_vector &)
Description not yet available.
void save_dmatrix_value() const
Description not yet available.
void verify_identifier_string(const char *)
Verifies gradient stack string.
static vector_shape_pool * xpool
dvar6_array & operator()(int i)
void save_lmatrix_value(void)
vector_shape & operator=(const vector_shape &)=delete
double & elem_value(int i) const
void deallocate(void)
Deallocate dvar5_array memory.
void open(const char *name, int mode=ios::out|ios::binary, int prot=0664)
Description not yet available.
Description not yet available.
Function minimizer control.
Abstract base class for different index types.
dmatrix & operator=(const dmatrix &t)
Assign values in other to dmatrix.
banded_symmetric_dmatrix restore_bounded_symmetric_dvar_matrix_derivatives(const dvar_matrix_position &_pos)
Description not yet available.
unsigned int get_ncopies() const
void shallow_copy(const d4_array &)
Copies pointer locations from other to d4_array.
void df_check_derivative_values_indexed(void)
Description not yet available.
dvector lower_triagular_solve(const dmatrix &m, const dvector &v)
Description not yet available.
void colfill_randn(const int &j, long int &n)
Fill random numbers into specified column j of matrix.
static adstring adprogram_name
friend void allocate_dvariable_space(void)
Description not yet available.
unsigned int size() const
const double & operator()(int i, int j) const
double gamma_density(double x, double r, double mu)
Gamma probability density function; constant objects.
friend uostream & operator<<(const uostream &, const dfsdmat &)
Description not yet available.
d5_array & operator=(const d5_array &)
Assigns element values from other to d5_array.
void save_prevariable_value() const
Description not yet available.
int operator==(const prevariable &v1) const
Description not yet available.
dvar5_array sub(int hhsl, int hhsu)
Description not yet available.
virtual int indexmax() const =0
dvar_vector & operator++(void)
double mean(const dvector &vec)
Returns computed mean of vec.
double norm(const d3_array &a)
Return computed norm value of a.
adstring get_string_marker(void)
Description not yet available.
dmatrix & operator()(int i, int j, int k, int l, int _m)
int operator<(double v0, const prevariable &v1)
Description not yet available.
unsigned int get_ncopies() const
friend prevariable & pow(const prevariable &t1, const prevariable &t2)
Description not yet available.
void default_evaluation3ind(void)
Description not yet available.
prevariable elem(int i, int j, int k)
? Retrieves an element of a dvar3_array.
dlist()
Default constructor.
double gmax
maximum gradient
ivector_position(void)
Default constructor.
void save_dvar_matrix_value() const
Description not yet available.
double better_rand()
Random number generator.
void operator/=(const prevariable &)
Description not yet available.
unsigned int colsize() const
double std_dev(const dvector &vec)
Returns the computed standand deviation of vec.
double besselI(double x, int nu)
static double cumd_normal_mixture(double x, double a)
Description not yet available.
dvar4_array & elem(int i)
void ad_set_new_handler(void)
Description not yet available.
Description not yet available.
void deallocate(void)
Deallocate d7_array memory.
const d5_array & operator()(int i) const
d4_array & operator()(int i, int j, int k)
int operator!(void) const
double restore_double_value()
Description not yet available.
friend dvector operator*(const dvector &, const dmatrix &)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
friend prevariable & operator/(const prevariable &t1, const prevariable &t2)
Description not yet available.
dvariable()
Default constructor.
Description not yet available.
void fill_randu_ni(long int &n)
Description not yet available.
dvar_matrix & elem(int i, int j, int k, int l)
void gradcalc(int nvar, const dvector &g)
d5_array & operator()(int i, int j)
virtual double_index_guts * operator[](int)=0
AD_LONG_INT & elem(int i)
double dflogistic(double a, double b, const double &x)
dvar6_array()
Description not yet available.
friend dvariable norm2(const dvar_matrix &)
df1_one_matrix choleski_decomp(const df1_one_matrix &MM)
void allocate(void)
Initialize members but does not allocate.
double expdev(const random_number_generator &_rng)
Description not yet available.
dvar_vector operator()(int i)
void save_double_value(const double x)
Description not yet available.
lvector & operator[](int i)
preivector(ivector *_p, int _lb, int _ub)
dvariable invlogit(dvariable x)
Inverse logit function.
sing_val_decomp singval_decomp(const dmatrix &_a)
Singular value decomposition.
void slave_gradcalc(void)
banded_lower_triangular_dmatrix & operator=(const banded_lower_triangular_dmatrix &)
Assigment operator.
dvector extract_column(const dmatrix &matrix, int j)
Extract copy of jth column vector from matrix m.
const dvar3_array & elem(int i) const
dvar3_array sub(int, int)
Description not yet available.
ivector sgn(const dvector &v)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
~dvar7_array()
Description not yet available.
double inv_cumd_beta_stable(double a, double b, double y, double eps)
virtual double_index_guts * operator[](int i)
i3_array(void)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
dvar_vector sub(int lb, int ub)
static int no_ln_det_choleski_flag
void default_evaluation4(void)
Description not yet available.
virtual int indexmax(void)
i5_array & operator=(const i5_array &)
friend prevariable & atan2(const prevariable &t1, const prevariable &t2)
Description not yet available.
dmatrix operator*(const d3_array &t, const dvector &v)
Description not yet available.
Holds the data for the prevariable class.
friend banded_lower_triangular_dmatrix value(const banded_lower_triangular_dvar_matrix &v)
Description not yet available.
void save_dvar_matrix_position() const
Description not yet available.
unsigned long int get_last_offset()
d3_array(void)
Default constructor.
void set_gradient_stack(void(*func)(void), double *dep_addr, double *ind_addr1=NULL, double mult1=0, double *ind_addr2=NULL, double mult2=0)
Description not yet available.
void exit_handler(int k)
Description not yet available.
Description not yet available.
dvar4_array & operator()(int i)
void colfill(int j, const dvar_vector &v)
Fills column of a matrix with a vector (supplied)
friend double max(const dvector &)
Returns the maximum value of vector vec.
friend dvar_vector elem_div(const dvar_vector &, const dvar_vector &)
Element-wise division of v1 by v2 into a dvar_vector.
void set_value_inv_partial(const dvector &x, const dvector &v, const int &ii, int n)
Description not yet available.
function_minimizer_exception(void)
virtual int dimension() const
void save_pointer_value(void *ptr)
Description not yet available.
friend void df_check_derivative_values(void)
Description not yet available.
dvar_matrix & elem(int i)
? Retrieves an element of a dvar3_array.
void deallocate(void)
Deallocate d6_array memory.
double inv_cumd_logistic(const double &x)
Description not yet available.
dvariable ln_det_choleski_error(const dvar_matrix &, int &ierr)
Description not yet available.
friend dvar_vector sfabs(const dvar_vector &)
Description not yet available.
virtual int isinteger() const
d3_array mfexp(const d3_array &m)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
int operator==(double v0, const prevariable &v1)
Description not yet available.
dmatrix fillout_trans(const lower_triangular_dmatrix &M)
Description not yet available.
dvariable(const double t)
Creates dvariable instance from a double constant.
dvar_vector_position()
Default constructor.
void save_dvar_matrix_position() const
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...
Description not yet available.
dvector_position restore_dvector_position()
Description not yet available.
const d4_array & operator()(int i, int j) const
Description not yet available.
const dvar_matrix & operator[](int i) const
const d3_array & elem(int i, int j) const
unsigned long int max_last_offset
d6_array & operator()(int i)
d3_array & operator=(const d3_array &m1)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
void deallocate(void)
Deallocate i4_array memory.
dvar_vector & elem(int i, int j, int k)
int operator!(void) const
void rowfill_randn_ni(const int &i, long int &n)
Description not yet available.
lmatrix restore_lmatrix_value(const lmatrix_position &)
void save_dmatrix_position(void) const
void write_on(const ostream &) const
Description not yet available.
dmatrix & operator--(void)
dvar3_array & operator=(const d3_array &m1)
Assign element values from scalar arr3 to dvar3_array.
dvar_vector ln_pareto_density(const dvar_vector &_y, const prevariable &alpha, const prevariable &xm)
double sfabs(const double v1)
Description not yet available.
void default_evaluation1(void)
Description not yet available.
double & elem(int i, int j, int k, int l, int _m, int _n)
dvector & operator[](int)
int bandwidth(void) const
int operator!(void) const
void deallocate(void)
Description not yet available.
void shallow_copy(const d3_array &)
Shallow copy other data structure pointers.
double log_density_cauchy(const double &x)
Description not yet available.
banded_lower_triangular_dmatrix choleski_decomp_trust_bound(const banded_symmetric_dmatrix &_M, const int &_ierr)
Description not yet available.
dvar5_array & operator=(const d5_array &)
Description not yet available.
dvar3_array(void)
Default constructor.
friend dvar_matrix inv(const dvar_matrix &)
Inverse of a varaiable matrix.
dvector solve(const dmatrix &aa, const dvector &z)
Solve a linear system using LU decomposition.
void allocate(int mmin, int mmax, int n, int m)
humungous_pointer ARRAY_MEMBLOCK_BASE
double randu(const random_number_generator &rng)
Uniform random number generator.
prescientific setscientific(void)
Description not yet available.
friend prevariable & tanh(const prevariable &t1)
Description not yet available.
void shallow_copy(const dvar_matrix &)
Shallow copy other data structure pointers.
Description not yet available.
friend dvariable sumsq(const dvar_vector &)
Description not yet available.
void fill_randbi_ni(long int &n, double)
Description not yet available.
static int print_hess_and_exit_flag
void df_check_derivative_values(void)
Description not yet available.
int & operator()(int i, int j, int k)
void reset_max_last_offset()
unsigned long int last_offset
virtual int indexmin(void)
friend double * address(const prevariable &v1)
void save_dmatrix_position(void) const
Description not yet available.
double bounder(double x, double min, double max, double scale)
Description not yet available.
friend char * fform(const char *, const dmatrix &)
void arr_free(double_and_int *varr)
Description not yet available.
dvariable cumd_bivariate_normal(const prevariable &xu, const prevariable &yu, const prevariable &rho, int nbox)
virtual int dimension() const
dmatrix sort(const dmatrix &m, int column, int NSTACK)
Description not yet available.
dmatrix symmetrize(const dmatrix &matrix)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
dvar_compressed_triplet(int mmin, int mmax, int n, int m)
dvar_matrix & operator+=(const dvar_matrix &x)
Description not yet available.
dvar_vector & operator-=(const prevariable &d)
Substracts d from each element of dvar_vector.
friend dmatrix trans(const dmatrix &m1)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
smart_counter()
Default constructor.
Description not yet available.
dvector restore_dvar_matrix_derivative_row(const dvar_matrix_position &_pos, const int &ii)
Description not yet available.
dmatrix atlas_solve_spd_trans(const dmatrix &M, const dmatrix &x)
Description not yet available.
prnstream & endl(prnstream &)
dmatrix eigenvectors(const banded_symmetric_dmatrix &_SS, const dvector &_e)
Description not yet available.
void fill_randu_ni(long int &n)
Description not yet available.
vector_shape(int lb, int lu)
ivector & operator()(void)
friend void gradcalc(int nvar, const dvector &g)
Description not yet available.
d4_array & elem(int i, int j)
double besselK(double x, int nu)
double boundpin(double x, double fmin, double fmax, double s)
Scale model variable over [-1,1]; constant objects.
friend dvar_matrix trans(const dvar_matrix &)
Description not yet available.
dvar_vector operator()(int lb, int ub)
independent_variables(int ncl, int ncu)
dmatrix restore_dmatrix_value(const dmatrix_position &mpos)
Description not yet available.
void allocate(void)
Does NOT allocate, but set empty i3_array.
Description not yet available.
Array of integers(int) with indexes from index_min to indexmax.
unsigned int get_ncopies() const
friend dvar_vector log(const dvar_vector &)
Description not yet available.
prevariable(double_and_int *u)
virtual ~index_guts()
Destructor.
void shallow_copy(const i4_array &)
Shallow copy other data structure pointers.
const dvar_matrix & elem(int i, int j, int k) const
dvector solve_trans(const lower_triangular_dmatrix &M, const dvector &y)
Description not yet available.
Description not yet available.
friend dvar_vector first_difference(const dvar_vector &)
Returns a dvector containing the differences of an x(i) and x(i + 1) for i = 1 to x...
virtual ~double_index_guts()
Description not yet available.
int operator()(void) const
d3_array sqrt(const d3_array &arr3)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
dmatrix identity_matrix(int min, int max)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
dvar5_array & operator()(int i)
prevariable_position(double_and_int *p)
dvar_vector & get_x(void)
double avg(double x, double y)
Average of two numbers; constant objects.
dmatrix & hessian()
Undefined.
dvector cumd_upper_trunc_pareto(const dvector &_y, double alpha, double xm)
void dmdm_prod(void)
Description not yet available.
void fill_randu(long int &n)
Fill matrix with random numbers.
uostream(const char *name, int mode=ios::out|ios::binary, int prot=0664)
friend dvar_vector exp(const dvar_vector &)
Description not yet available.
void fill_randn_ni(long int &n)
Description not yet available.
dvector return_choleski_decomp_solve(dcompressed_triplet &dct, dvector &eps)
virtual ~vector_index()
Destructor.
dvector rowsum(const dmatrix &matrix)
Returns dvector where each element contains the sum total of each row in matrix.
void gradfree(dlink *v)
Description not yet available.
prevariable elem(int i) const
void initialize(void)
Description not yet available.
friend void allocate_dvariable_space(void)
Description not yet available.
const dvar5_array & elem(int i) const
dvar_matrix & operator/=(const prevariable &t)
Description not yet available.
d3_array sub(int, int)
Description not yet available.
double var(const dvector &vec)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
friend prevariable & sinh(const prevariable &t1)
Description not yet available.
dvar3_array & elem(int i, int j, int k, int l)
ad_double & operator=(const ad_double &)=delete
friend void funnel_derivatives(void)
Description not yet available.
unsigned long int get_max_last_offset()
arr_link * get_next() const
int operator!(void) const
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...
const d3_array & operator[](int i) const
void arr_free_remove(arr_link *tmp)
Description not yet available.
banded_lower_triangular_dmatrix(const dvar_matrix_position &mpos)
Description not yet available.
dvar_vector & elem(int i, int j, int k, int l, int _m)
friend dvar_vector sin(const dvar_vector &)
Computes sin of each element in v1 to a dvar_vector.
const dmatrix & operator()(int i, int j, int k, int l, int _m) const
void fmin2(const double &f, const independent_variables &x, const dvector &g, function_minimizer *)
Description not yet available.
virtual int indexmax() const
virtual int indexmax(void)=0
void colfill_randu(const int &j, long int &n)
Description not yet available.
void deallocate()
Deallocate dvar_matrix memory.
double restore_prevariable_value()
Description not yet available.
friend void copy_status(const ostream &s, const dvar_vector &v)
Description not yet available.
void set_value_partial(const dvar_vector &x, const dvar_vector &v, const int &ii, int n)
Description not yet available.
arr_link()
Default constructor.
Description not yet available.
Derived class of index types for imatrix.
void operator-=(const prevariable &t1)
Description not yet available.
Description not yet available.
dvar_matrix empirical_covariance(const dvar_matrix &v1)
Description not yet available.
arr_link * get_prev() const
int indexmax() const
Get maximum valid index.
friend void grad_chk(void)
Description not yet available.
Description not yet available.
prevariable elem(int i, int j, int k, int l, int _m, int _n)
void allocate(void)
Description not yet available.
void colfill_randu_ni(const int &j, long int &n)
Description not yet available.
dvar_matrix & elem(int i, int j, int k, int l, int _m)
double & operator()(int i, int j)
dvar_vector & operator+=(const prevariable &d)
Adds d to each element of dvar_vector.
double & elem(int i, int j, int k, int l, int _m, int _n, int _p)
void fill_multinomial(const int &seed, const dvector &p)
Description not yet available.
preshowpoint setshowpoint(void)
Description not yet available.
dvar3_array & elem(int i)
arr_link * get_last() const
ad_double(const ad_double &other)
void save_dvar_vector_value() const
Saves the size, address, and value information for a dvar_vector.
Description not yet available.
friend char * fform(const char *, const dmatrix &)
Description not yet available.
friend dvariable norm(const banded_symmetric_dvar_matrix &B)
Description not yet available.
dvariable inv_cumd_normal_logistic_mixture(const prevariable &_yy, double a)
void allocate(void)
Does not allocate, but initializes members.
Description not yet available.
void normalized_gauss_hermite(const dvector &_x, const dvector &_w)
Gauss-Hermite quadature.
d7_array & operator=(const d7_array &)
Assign element values from other to d7_array.
prevariable elem(int i, int j, int k, int l)
friend uistream & operator>>(const uistream &, const dfsdmat &)
Description not yet available.
const dvar_matrix & elem(int i, int j, int k, int l, int _m) const
double get_elapsed_time_and_reset(void)
Returns elapsed time in milliseconds of timer object and then resets the timer to current time...
uostream & operator<<(const char *)
double colsum(const dmatrix &m, int col)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
const prevariable operator()(int i, int j, int k, int l, int _m, int _n, int _p) const
void save_dmatrix_derivatives_na(const dvar_matrix_position &pos) const
Description not yet available.
void fill_randu_ni(long int &n)
Description not yet available.
unsigned int incr_ncopies(void)
ivector histogram(double min, double max, int nbin, const dvector &input)
Description not yet available.
void deallocate(void)
Deallocate dvar4_array memory.
unsigned int get_ncopies() const
dvariable log_der_logistic(double a, double b, const prevariable &x)
Description not yet available.
d5_array()
Description not yet available.
double minimize(const independent_variables &x, double(*pf)(const dvar_vector &))
Minimize artibrary user-supplied function.
double sgamma(double a, const random_number_generator &_rng)
Description not yet available.
Functions and variables for function minimizer.
vcubic_spline_function(const dvector &_x, const dvar_vector &_y, double yp1=0.0, double ypn=0.0)
Description not yet available.
void rowshift(int min)
Description not yet available.
Description not yet available.
d3_array exp(const d3_array &arr3)
Returns d3_array results with computed exp from elements in arr3.
dvar4_array sub(int, int)
Description not yet available.
void create_gradfile()
Description not yet available.
dvector cumd_pareto(const dvector &_y, double alpha, double xm)
Description not yet available.
adtimer(void)
Default constructor.
void set_gradstack_flag(char *str)
Description not yet available.
unsigned int get_ncopies() const
dvar6_array & elem(int i)
int smbfct_(int *neqns, ivector &xadj, ivector &adjncy, ivector &perm, ivector &invp, ivector &xlnz, int *maxlnz, ivector &xnzsub, ivector &nzsub, int *maxsub, ivector &rchlnk, ivector &mrglnk, ivector &marker, int *flag__)
void save_dmatrix_derivatives(const dvar_matrix_position &pos) const
Description not yet available.
dmatrix choleski_decomp_error(const dmatrix &MM, int &ierror)
Description not yet available.
friend prevariable & asin(const prevariable &t1)
Description not yet available.
void default_evaluation(void)
Description not yet available.
Description not yet available.
const d3_array & elem(int i, int j, int k, int l) const
humungous_pointer ARRAY_MEMBLOCK_SAVE
ad_double(const double &_d, const adkludge &)
Description not yet available.
banded_symmetric_dvar_matrix(int _min, int _max, int _bw)
Description not yet available.
const dvar5_array & elem(int i, int j) const
Description not yet available.
static _THREAD gradient_structure * _instance
imatrix & operator[](int i)
void allocate(int, int)
Allocate array [ncl,...,nch].
friend ostream & operator<<(const ostream &, const dvar_matrix_position &)
void deallocate(void)
Deallocates i5_array memory if no copies exists.
virtual int indexmin() const
virtual index_guts * operator[](int i)
dmatrix & operator-=(const dmatrix &t)
Substract element-wise matrix values other from dmatrix.
dmatrix outer_prod(const dvector &v1, const dvector &v2)
Description not yet available.
void insert_identifier_string(const char *s)
Description not yet available.
void rowfill_seqadd(const int &, double, double)
Fills vector with a sequence of the form base, base+offset, base+2*offset,...
d5_array & elem(int i, int j)
friend dvariable norm2(const dvar_vector &)
Description not yet available.
dmatrix restore_dvar_matrix_value(const dvar_matrix_position &mpos)
Description not yet available.
friend dvar_vector fabs(const dvar_vector &)
Description not yet available.
virtual double_index_guts * operator[](int i)
friend prevariable & cos(const prevariable &t1)
Description not yet available.
void df_check_derivative_values_indexed_break(void)
Description not yet available.
lmatrix_position restore_lmatrix_position(void)
Description not yet available.
void rowfill_randn_ni(const int &i, long int &n)
Description not yet available.
i4_array()
Default constructor.
prevariable_position restore_prevariable_position(void)
double betai(const double a, const double b, const double x, int maxit)
Incomplete beta function for constant objects.
banded_symmetric_dmatrix & operator=(const banded_symmetric_dmatrix &)
Description not yet available.
dmatrix column_vector(const dvector &v)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Description not yet available.
Description not yet available.
void shallow_copy(const d6_array &)
Shallow copy other data structure pointers.
dvar_matrix sub(int, int)
Description not yet available.
void ad_getcd(const adstring &s)
Description not yet available.
void shift(int)
Description not yet available.
friend void gradcalc(int nvar, const dvector &g)
int operator!(void) const
void write_on(const ostream &) const
Description not yet available.
friend double & value(const prevariable &v1)
void allocate(void)
Description not yet available.
lmatrix_position(const lmatrix &)
unsigned int get_ncopies() const
ptr_vector & operator=(const ptr_vector &t)
Copy values from _t to this.
unsigned int hslicesize() const
void initialize(void)
Initializes all elements of d3_array to zero.
static ad_double make_ad_double(double _d)
void fill_randn_ni(long int &n)
Description not yet available.
dfunction_tweaker(double eps, double mult)
Description not yet available.
virtual int indexmin(void)
unsigned long * mt
the array for the state vector
const dvar4_array & elem(int i) const
void set_value(const dvar_matrix &x, const dvar_vector &v, const int &_ii, double s)
Description not yet available.
Description not yet available.
void allocate(void)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
unsigned int ncopies
Copy counter to enable shallow copies.
AD_LONG_INT & operator[](int i)
grad_stack_entry * ptr_first
double_and_int * v
pointer to the data
double norm2(const d3_array &a)
Return sum of squared elements in a.
Description not yet available.
spdll_exception(int _e=0)
matrix_index(const imatrix &v)
virtual int isdouble_(void) const
const dvar_vector operator()(int i) const
dfsdmat()
Default constructor.
void rowfill_seqadd(const int &, double, double)
Fills dmatrix row at index with elements with values starting from base and incremented by offset...
dmatrix MAT(const dvector &v, int n, int m)
The MAT operator is the inverse of the VEC operator.
dvector & elem(int i, int j, int k, int l, int _m)
double fill_seqadd(double, double)
Description not yet available.
void fill_randn_ni(long int &n)
Description not yet available.
dvariable(const int &t)
Creates dvariable instance from a int constant.
random_number_generator(const int seed)
Constructor for random_number_generator class.
dmatrix orthpoly(int n, int deg)
Description not yet available.
int save_identifier_string(const char *)
Writes a gradient stack verification string.
const dmatrix & operator()(int i, int j, int k, int l) const
double robust_normal_logistic_mixture_deviate(double x, double spread)
Description not yet available.
void colfill(int j, const dvector &v)
Fills dmatrix column at index column with values from vec.
void restore(void)
Restore values to file.
Description not yet available.
int operator!(void) const
dvector restore_dvar_vector_value(const dvar_vector_position &tmp)
Restores the size, address, and value information for a dvar_vector.
const dvar_vector & elem(int i, int j, int k, int l, int _m) const
fmmt1(int nvar, int _xm=7)
Description not yet available.
double ln_det(const dmatrix &m1, int &sgn)
Compute log determinant of a constant matrix.
Description not yet available.
void set_value_inv(const dvar_matrix &x, const dvector &v, const int &ii, double s)
Description not yet available.
virtual ~matrix_index()
Destructor.
friend prevariable & log10(const prevariable &t1)
Description not yet available.
void restore_variables()
Restore variables from buffer.
static cifstream * global_datafile
index_type operator[](int i)
Description not yet available.
double dftinv(double x, double fmin, double fmax)
Inverse of dvariable dfatan1(dvariable x, double fmin, double fmax, const prevariable& _fpen) ...
const dmatrix & elem(int i, int j, int k, int l) const
Description not yet available.
double & elem(int i, int j)
void ad_begin_funnel(void)
Description not yet available.
dvector restore_dvar_vector_der_nozero(const dvar_vector_position &tmp)
Description not yet available.
int option_match(int argc, char *argv[], const char *string)
Checks if the program has been invoked with a particular command line argument ("string").
void save_dvar_matrix_position() const
Description not yet available.
mat_shapex(const void *m)
dvar_vector & operator--(void)
adstring str(double x, int minwidth=17, int decplaces=-1)
Convert x to adstring with minimum width and total number of decimal places.
void operator/=(const prevariable &d)
Description not yet available.
static char option_flags[]
void initialize()
Description not yet available.
void save_ad_pointer(void *p)
Description not yet available.
friend ostream & operator<<(const ostream &, const pre_column_print &)
Description not yet available.
virtual int indexmin(void)
int operator!(void) const
~dvar_vector()
Destructor.
double & operator()(const int &i)
Get element i from dvar_vector_position.
std::ostream & get_output_stream()
unsigned int rowsize() const
Description not yet available.
double mult1
First mutiplicand in chain rule multipication.
void initialize()
Initialize all elements of i3_array to zero.
dvector column_value(const dvar_matrix &m, int i)
Description not yet available.
void initialize()
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
dlink * create()
Return new unlinked node.
void fill_randu(long int &n)
unsigned int get_status() const
dvector csolve(const dmatrix &aa, const dvector &z)
Solve a linear system using LU decomposition.
void save_lmatrix_position(void)
dvariable & operator=(const double x)
Assigns a value to a dvariable object.
prevariable & operator+=(const prevariable &)
Prevariable addition assignment operator.
dvector_position(void)
Default constructor.
Description not yet available.
Description not yet available.
void fill_seqadd(const AD_LONG_INT &, const AD_LONG_INT &)
Fills ivector elements with values starting from base and incremented by offset.
void initialize(void)
Description not yet available.
void operator/=(const prevariable &d)
Description not yet available.
int operator!(void) const
d6_array & operator=(const d6_array &)
Assigns element values from other to d6_array.
virtual int indexmin() const
void rowfill(int j, const dvar_vector &v)
Fills row of a matrix with a vector (supplied)
Float betacf(Float a, Float b, Float x, int MAXIT)
friend prevariable & operator+(const prevariable &v1, const prevariable &v2)
Description not yet available.
virtual ~ad_comm()
Destructor.
void shallow_copy(const d7_array &)
Shallow copy other data structure pointers.
void put_address(unsigned int &i, double *iaddress)
void save_d3_array_position() const
Description not yet available.
dvar_matrix tensor_prod(const dvar_matrix &a, const dvar_matrix &b)
The tensor product of two dvar_matrixes.
prevariable & operator=(const prevariable &)
Assigns a value to a prevariable object.
int operator<=(const prevariable &v1) const
Description not yet available.
double lower_triangular_ln_det(const dmatrix &m)
Holds "shape" information for vector objects.
const dvar_vector & elem(int i, int j, int k) const
friend char * fform(const char *, const dvar_vector &)
void deallocate(void)
Deallocate d5_array memory.
dvariable ghk_choleski_m(const dvar_vector &upper, const dvar_matrix &ch, const dmatrix &eps)
Description not yet available.
void save_variables()
Save variables to a buffer.
friend prevariable & sin(const prevariable &t1)
Description not yet available.
dmatrix make_dmatrix(dcompressed_triplet &M)
d3_array & elem(int i, int j, int k, int l)
dvector & elem(int i, int j, int k, int l, int _m, int _n)
double * initpointer(void)
unsigned int size() const
d3_array cos(const d3_array &arr3)
Returns d3_array results with computed cos from elements in arr3.
void shallow_copy(const d5_array &)
Shallow copy pointers from other data structure.
const d5_array & elem(int i, int j) const
Description not yet available.
friend banded_lower_triangular_dmatrix restore_banded_lower_triangular_dvar_matrix_value(const dvar_matrix_position &mpos)
Description not yet available.
void initialize()
Description not yet available.
void * farptr_norm(void *)
virtual int indexmax(void)
void save_dvar_vector_position() const
Description not yet available.
unsigned long int number_arr_links
dvar_matrix()
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
istream & operator>>(const istream &input, const d3_array &arr3)
Read values from input stream into arr3.
Description not yet available.
sdmatrix()
Default constructor.
const prevariable operator()(int k, int i, int j) const
void fill_randn_ni(long int &n)
void deallocate(void)
Deallocates d4_array memory.
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
double gasdev(const random_number_generator &_rng)
Description not yet available.
dmatrix orthpoly_constant_begin_end(int n, int deg, int nconst_begin, int enddeg, int nconst_end)
Description not yet available.
void arr_free_add(arr_link *tmp)
Description not yet available.
imatrix & elem(int i, int j)
ostream & operator<<(const ostream &_s, preshowpoint p)
Description not yet available.
friend void df_check_derivative_values_indexed_break(void)
Description not yet available.
dvector_index(const dvector &v)
Description not yet available.
void operator/=(const prevariable &d)
Description not yet available.
friend void copy_status(const ostream &s, const dvar_matrix &m1)
Description not yet available.
friend double norm2(const banded_symmetric_dmatrix &B)
void operator*=(const prevariable &v1)
Description not yet available.
dmatrix diagonal_matrix(const dvector &v)
unsigned int colsize() const
d5_array & operator()(int i)
d4_array & operator[](int i)
friend char * fform(const char *, const prevariable &)
AD_LONG_INT & operator()(int i)
void allocate(void)
Description not yet available.
void save_dmatrix_position() const
Saves size and address information for a dmatrix to adjoint data file.
const prevariable elem(int i, int j, int k, int l, int _m, int _n, int _p) const
int read_grad_stack_buffer(OFF_T &lpos)
Description not yet available.
void default_evaluation4ind(void)
Description not yet available.
void allocate(void)
Does not allocte, but initialize class members.
lower_triangular_dmatrix lower_triangular_choleski_decomp_positive(const dmatrix &MM, const int &_ierr)
Description not yet available.
banded_symmetric_dmatrix(void)
virtual index_guts * operator[](int i)
Description not yet available.
banded_symmetric_dmatrix sub(int l, int u)
Description not yet available.
dvar_matrix & operator=(const dvar_matrix &)
Assigns other values to dvar_matrix.
int operator>(double v0, const prevariable &v1)
Description not yet available.
int operator<=(double v0, const prevariable &v1)
Description not yet available.
dvector inv_cumd_upper_trunc_pareto(const dvector &_y, double alpha, double xmin, double xmax)
virtual ~dvariable()
Destructor; frees memory on gradient stack.
double_index_type operator()(int i)
Description not yet available.
friend prevariable & sfabs(const prevariable &t1)
Smooth absolute value.
double regression(const dvector &obs, const dvector &pred)
Description not yet available.
void allocate(void)
Description not yet available.
const dvar3_array & elem(int i, int j, int k, int l) const
char var_store_file_name[61]
dvariable & operator=(const prevariable &other)
Assigns a value to a dvariable object.
void rowshift(int min)
Changes the range of valid indices for the rows.
friend banded_symmetric_dmatrix restore_banded_symmetric_dvar_matrix_value(const dvar_matrix_position &mpos)
Description not yet available.
double randn(const random_number_generator &rng)
Normal number generator.
size_t pos(const adstring &substr, const adstring &s)
dvar7_array & operator=(const d7_array &)
Description not yet available.
prevariable elem(int i, int j, int k, int l, int _m, int _n, int _p)
friend dvar_vector operator*(const dvar_vector &, const dvar_matrix &)
Description not yet available.
void fill(const char *s)
Description not yet available.
Description not yet available.
double randpoisson(double xm, const random_number_generator &rng)
Poisson random deviates.
int mti
mti==N+1 means mt[N] is not initialized
void shallow_copy(const dvar3_array &)
Shallow copy other data structure pointers.
Support functions for factor.
vector_range_exception(int i, int imin, int imax)
Description not yet available.
ivector restore_ivector_value(const ivector_position &tmp)
Description not yet available.
independent_variables(unsigned int sz, double *x)
Class definition of matrix with derivitive information .
void read_from(const istream &)
Description not yet available.
const dvar6_array & elem(int i) const
index_type(const int x)
Description not yet available.
double minimize(const independent_variables &x, double(*pf)(const dvar_vector &))
dmatrix & operator++(void)
double inv_cumd_cauchy(const double &x)
Description not yet available.
int operator!(void) const
three_array_shape * shape
pre_double_index_type(const double_index_type *_a, int _i)
const dvector & operator()(int i, int j, int k, int l, int _m) const
const dvar3_array & elem(int i, int j) const
dvar_vector ln_pareto_upper_trunc_density(const dvar_vector &y, const prevariable &alpha, const prevariable &xmin, const prevariable &xmax)
int operator!(void) const
dvector restore_dvar_vector_derivatives(const dvar_vector_position &tmp)
Description not yet available.
void save_int_value(int x)
Description not yet available.
dvariable dfboundp(const prevariable &x, double fmin, double fmax)
Computes the derivative of dvariable boundp(const prevariable& x, double fmin, double fmax...
void shallow_copy(const dvar_vector &)
Shallow copy other data structure pointers.
dvariable mf_upper_bound(const prevariable &x, double M, prevariable &fpen)
Description not yet available.
void initialize()
Initialize all elements of d5_array to zero.
Description not yet available.
unsigned int get_ncopies() const
Description not yet available.
d4_array & operator=(const d4_array &)
Assigns element values from other to d4_array.
void restore_variables()
Restore variables from buffer.
double ln_det_choleski(const banded_symmetric_dmatrix &MM, int &ierr)
void colfill_randu(const int &j, long int &n)
Fill random numbers into specified column j of matrix.
unsigned int get_ncopies() const
const double & elem_value(int i, int j) const
Description not yet available.
virtual int indexmin() const =0
dmatrix & operator[](int i)
dvariable operator()(const prevariable &)
Description not yet available.
void shift(int)
Description not yet available.
void deallocate(void)
Deallocate dvar7_array memory.
friend prevariable & exp(const prevariable &t1)
Compute exponential variable.
void save_d3_array_value() const
Description not yet available.
double & elem(int i, int j, int k, int l)
double & operator()(int k, int i, int j)
void set_value_inv_exp(const prevariable &x, const dvector &_v, const int &_ii, double fmin, double fmax, double s)
double logistic(double a, double b, const double &x)
d7_array()
Description not yet available.
dvector extract_row(const dmatrix &matrix, int i)
Returns a copied row for matrix at i.
double & elem(int i, int j, int k, int l, int _m)
Description not yet available.
unsigned int size_count(const dvector &x)
Returns total size of elements in vector x.
d3_array & elem(int i, int j, int k)
unsigned int get_ncopies() const
uistream(const char *name, int mode=ios::in|ios::binary, int prot=0664)
Description not yet available.
dvariable boundp(const prevariable &x, double fmin, double fmax, const prevariable &_fpen, double s)
Compute penalty for exceeding bounds on parameter; variable ojbects.
double cumd_exponential(double x)
Description not yet available.
void colshift(int min)
Description not yet available.
const dmatrix & elem(int i, int j) const
void fill_randn(long int &n)
Description not yet available.
dvector & elem(int i, int j, int k, int l)
int operator!=(const prevariable &v1) const
Description not yet available.
dvector sinh(const dvector &vec)
Returns dvector with hyperbolic sine for each value of vec.
dvariable dtweedie(const double y, dvariable &mu, dvariable &phi, dvariable &p, const bool use_log)
dtweedie is a wrapper to _dtweedie using ADMB data types.
double & elem(int i, int j)
dvector choleski_solve_error(dmatrix M, dvector &v, int &ierror)
Description not yet available.
prevariable()=delete
Default constructor.
fmm_control()
Default constructor.
void shallow_copy(const dmatrix &)
Shallow copy values and dimensions from other to dmatrix.
void rowfill_randn(const int &i, long int &n)
Description not yet available.
unsigned int size() const
dvar_vector & elem(int i, int j, int k, int l)
void read_from(const istream &)
ivector_position restore_ivector_position()
Description not yet available.
void * restore_pointer_value()
Description not yet available.
void rowfill_randn(const int &i, long int &n)
Fill random numbers into specified row i of matrix.
void colfill_seqadd_ni(const int &, double, double)
void save_dmatrix_value() const
Description not yet available.
void shallow_copy(const dvar6_array &)
Shallow copy other data structure pointers.
virtual int isinteger() const
double_index_type operator[](int i)
Description not yet available.
Description not yet available.
unsigned int slicesize() const
friend void gradcalc(int nvar, const dvector &g)
void reset_gradient_stack(void)
Rewind buffer.
static streampos change_datafile_name(const adstring &s, const streampos &off=0)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Description not yet available.
double sign(const double x)
The sign of a number.
Description not yet available.
double & operator()(int i)
three_array_shape * shape
void shallow_copy(const dvar5_array &)
Shallow copy other data structure pointers.
unsigned int rowsize() const
prevariable operator()(int i, int j)
void set_gradient_stack0(void(*func)(void), double *dep_addr)
Description not yet available.
void operator/=(double d)
Divide all elements of d7_array by divisor.
double cumd_cauchy(const double &x)
Description not yet available.
Description not yet available.
const dvector operator()(int i) const
dvariable & operator=(const dvariable &other)
~dvar4_array()
Destructor.
unsigned int get_ncopies() const
predvector(dvector *_p, int _lb, int _ub)
Description not yet available.
dvariable(const dvariable &t)
Copy constructor for dvariable object; deep copy.
const d3_array & operator()(int i, int j, int k) const
unsigned int get_ncopies() const
const dmatrix & elem(int i, int j, int k) const
d4_array sub(int, int)
Description not yet available.
friend void default_evaluation(void)
Description not yet available.
void fill(const char *)
Fill allocated dmatrix with values from input parameter s.
double cumbvn(const double &x, const double &y, const double &rho)
Cumulative bivariate normal distribution.
void deallocate()
Deallocate dvar_vector memory.
friend dmatrix operator+(const dmatrix &, const dmatrix &)
Description not yet available.
double dot(const dmatrix &M, const dmatrix &d2)
Description not yet available.
friend dvariable norm(const dvar_matrix &)
Description not yet available.
dvector operator()(int i)
dvar4_array()
Default Constructor.
dvar_vector & elem(int i) const
double cumd_norm_logistic(double _x, double p)
Description not yet available.
double cumd_logistic(const double &x)
Description not yet available.
friend banded_symmetric_dmatrix value(const banded_symmetric_dvar_matrix &v)
Description not yet available.
d3_array operator/(const d3_array &m, const double d)
Author: David Fournier.
dvar_vector ln_upper_trunc_pareto_density(const dvar_vector &_y, const prevariable &alpha, const prevariable &xm)
dvariable cumd_normal_cauchy_mixture(const prevariable &_x, double _a)
dvector column(const dmatrix &matrix, int j)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
vector_shape_pool(const size_t n)
dvar_vector & operator=(const dvar_vector &t)
Assign values from other t to dvar_vector.
friend dvar_vector second_difference(const dvar_vector &)
void default_evaluation4m(void)
Description not yet available.
int operator<(const prevariable &v1) const
Description not yet available.
double fill_seqadd(double, double)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
void write_on(const ostream &) const
dvar_vector & operator()(int i)
void save_dmatrix_value(void) const
void nograd_assign_column(const dvar_matrix &m, const dvector &v, const int &ii)
Description not yet available.
prevariable_position restore_prevariable_position()
Description not yet available.
d4_array & operator()(int i)
void RETURN_ARRAYS_INCREMENT(void)
Increments gradient_structure::RETURN_ARRAYS_PTR.
dvariable(const prevariable &t)
Constructor for dvariable object from its base class; deep copy.
virtual double_index_guts * operator[](int i)
Description not yet available.
friend void gradcalc(int nvar, const dvector &g)
const dvector operator()(int i) const
void read_from(const istream &)
Description not yet available.
unsigned int slicesize() const
int make_sub_directory(const char *s)
Create a sub directory s.
const dvar_vector & elem(int i, int j, int k, int l) const
void va13c(const dvector &x, double f, const dvector &g)
const double * initpointer(void) const
unsigned long int get_number_arr_links()
Description not yet available.
double log_density_poisson(double x, double mu)
Log Poisson density; constant objects.
void initialize()
Initializes elements of i4_array to zero.
dvector value(const df1_one_vector &v)
void fill_seqadd(double, double)
Description not yet available.
Description not yet available.
int operator!(void) const
void set_gradient_stack2(void(*func)(void), double *dep_addr, double *ind_addr1, double mult1)
Description not yet available.
dvector VEC(const dmatrix &_m)
The VEC operator concatenates the columns of matrix M into a column vector.
unsigned int slicesize() const
double_and_int *& get_v()
dvar_vector_position restore_dvar_vector_position()
Description not yet available.
dvector * left_bracket_gradient
static cifstream * global_parfile
void save_double_derivative(const double x, const prevariable_position &_pos)
Description not yet available.
i3_array & operator[](int j)
dvariable(kkludge_object)
Specialized constructor that does not create unnecessary entries in the gradient structure; see funct...
Description not yet available.
friend double ln_det(const dmatrix &m1, int &sgn)
Compute log determinant of a constant matrix.
void rowfill_randu_ni(const int &i, long int &n)
Description not yet available.
static _THREAD grad_stack * GRAD_STACK1
void colshift(int min)
Description not yet available.
friend prevariable & acos(const prevariable &t1)
Description not yet available.
double & xvalue()
Return the value of the variable.
void check_choleski_decomp(const banded_symmetric_dvar_matrix &MM, int &ierr)
friend prevariable & cosh(const prevariable &t1)
Description not yet available.
const d4_array & elem(int i, int j, int k) const
int operator!(void) const
void report_gradstack_flag(void)
Description not yet available.
unsigned int size() const
int operator!(void) const
d3_array_position restore_d3_array_position()
Description not yet available.
class for things related to the gradient structures, including dimension of arrays, size of buffers, etc.
Description not yet available.
friend void default_evaluation(void)
Description not yet available.
void deallocate()
Description not yet available.
dvariable posfun2(const dvariable &x, const double eps, const prevariable &pen)
Retuns a positive function of the argument and sets a penalty for .
void save_dmatrix_derivatives(const dvar_matrix_position &_pos, const double x, const int &i, int &j)
Description not yet available.
const dvar4_array & elem(int i, int j) const
void free()
Description not yet available.
void fill(const char *)
Fill values of dvar_matrix with text input from s with format rowmin...rowmax where ith row is {colmi...
dvariable ghk_choleski_m_cauchy(const dvar_vector &upper, const dvar_matrix &ch, const dmatrix &eps)
Description not yet available.
dvar7_array()
Description not yet available.
Class object for init_bounded_number vector.
void fill_randn(long int &n)
Description not yet available.
dmatrix orthpoly_constant_begin(int n, int deg, int nconst)
Description not yet available.
const dmatrix & elem(int i, int j, int k, int l, int _m) const
void colfill_randu_ni(const int &j, long int &n)
Description not yet available.
double cumd_norm(const double &x)
Culative normal distribution; constant objects.
friend void reset_gradient_stack(void)
Rewind buffer.
prevariable operator()(int i)
dvector * right_bracket_gradient
friend double sumsq(const dmatrix &)
Calls norm2.
dvector operator()(int i)
int & elem(int i, int j, int k, int l)
void initialize()
Description not yet available.
void fill_randpoisson(double lambda, const random_number_generator &rng)
Description not yet available.
prefixed setfixed(void)
Description not yet available.
ivector as_factor(const dvector &v, const double eps)
friend void funnel_gradcalc(void)
Description not yet available.
double beta_deviate(double a, double b, double x, double eps)
Description not yet available.
double log_density_negbinomial(double x, double mu, double tau)
Log negative bionomial density; constant objects.
dmatrix & operator+=(const dmatrix &t)
Add element-wise matrix values other to dmatrix.
uistream & operator>>(int &)
void initialize()
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
dvar_matrix & operator*=(const prevariable &t)
Description not yet available.
void tracing_message(int traceflag, const char *s)
Description not yet available.
void fill_randu(const random_number_generator &rng)
Description not yet available.
dvector operator&(const dvector &a, const dvector &b)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
friend double sumsq(const banded_symmetric_dmatrix &B)
virtual index_guts * operator[](int)=0
dvector return_choleski_factor_solve(hs_smatrix *PL, dvector &eps)
ptr_vector()
Default constructor.
const double & operator()(int i, int j) const
d4_array()
Default constructor.
banded_lower_triangular_dmatrix restore_banded_lower_triangular_dvar_matrix_value(const dvar_matrix_position &mpos)
Description not yet available.
double_and_int * gradnew()
Creates an entry in the gradient structure linked list.
virtual int dimension() const
dvar6_array & operator=(const d6_array &)
Description not yet available.
void initialize(void)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
const dvar3_array & elem(int i, int j, int k) const
grad_stack_entry * ptr_last
void operator/=(double d)
Divides all elements of d6_array by divisor.
double log_negbinomial_density(double x, double mu, double tau)
pre_zero_print zero_print(const dvector &v)
Description not yet available.
void(* func)(void)
< Pointer to function (if any) to be used for derivative calculation
int operator>=(double v0, const prevariable &v1)
Description not yet available.
friend void make_indvar_list(int, dvariable *)
friend dvariable ln_det(const dvar_matrix &, int &sgn)
The implementation of this algorithm was inspired by "Numerical Recipes in C", 2nd edition...
friend void slave_gradcalc(void)
void check_derivative_values_break(const char *s, int i, int b)
Description not yet available.
friend char * fform(const char *, const dvar_matrix &)
Description not yet available.
dvector_position operator()(int i)
Description not yet available.
hs_smatrix * return_choleski_decomp(dcompressed_triplet &st)
prevariable_position(const prevariable &x)
friend double norm2(const dmatrix &)
Norm squared of a matrix; constant object.
static unsigned int wd_flag
dvar_vector & operator*=(const prevariable &d)
Description not yet available.
double * dep_addr
Pointer to dependent variable.
Description not yet available.
prevariable operator()(int i, int j)
lvector & operator()(int i)
void fill_randnegbinomial(double lambda, double tau, const random_number_generator &rng)
Description not yet available.
Description not yet available.
dmatrix_position(const dmatrix &)
Description not yet available.
lvector & operator=(const lvector &t)
Description not yet available.
void increment_current_gradfile_ptr(void)
If there is another file set the handle to point to it otherwise we are out of room.
Description not yet available.
double inv_cumd_normal_mixture(double yy, double a)
Description not yet available.
double normal_tail_right(const double &x)
Description not yet available.
const prevariable elem(int i, int j, int k, int l, int _m) const
void fill_randn(long int &n)
friend dvar_vector operator+(const dvar_vector &, const dvar_vector &)
Description not yet available.
virtual ~dvector_index()
Destructor.
double minimize(const independent_variables &x, double(*pf)(const dvar_vector &))
friend void cleanup_temporary_files()
Close gradient and variable files and free gradient structure memory.
friend prevariable & operator*(const prevariable &v1, const prevariable &v2)
Description not yet available.
dvector restore_dvector_value(const dvector_position &tmp)
Restores the size, address, and value information for a dvector.
friend dvar_matrix operator-(double, const dvar_matrix &)
Description not yet available.
dvar5_array & elem(int i, int j)
d4_array vale(d4_array &)
~dvar3_array()
Destructor.
void deallocate()
Deallocate dvar3_array memory.
void check_derivative_values(const char *s)
Description not yet available.
multi_index(int min, int max, int dim)
Description not yet available.
double square(const double value)
Return square of value; constant object.
Description not yet available.
void initialize()
Initialize i5_array elements with zeros.
void deallocate()
Description not yet available.
Description not yet available.
Fundamental data type for reverse mode automatic differentiation.
df1_one_variable inv(const df1_one_variable &x)
friend dvariable norm(const dvar_vector &)
Description not yet available.
double_and_int * get_va() const
friend dvar_matrix operator+(const dvar_matrix &, const dvar_matrix &)
Description not yet available.
d3_array log(const d3_array &arr3)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
dvariable ghk_choleski_m_logistic(const dvar_vector &upper, const dvar_matrix &ch, const dmatrix &eps)
Description not yet available.
dmatrix choleski_decomp_positive(const dmatrix &MM, double bound)
Description not yet available.
int ad_printf(FILE *stream, const char *format, Args...args)
banded_symmetric_dmatrix restore_banded_symmetric_dvar_matrix_value(const dvar_matrix_position &mpos)
Description not yet available.
void initialize()
Description not yet available.
const prevariable operator()(int i, int j) const
dmatrix & operator/=(double d)
Divide value to all elements in dmatrix.
const double & elem(int i, int j, int k, int l, int _m, int _n, int _p) const
double inv_cumd_norm_logistic(double x, double p)
Description not yet available.
dmatrix & elem(int i, int j, int k, int l, int _m)
void allocate(void)
Does not really allocate, but empties the array.
double ddouble(void) const
Description not yet available.
Description not yet available.
void save_prevariable_position() const
Description not yet available.
d4_array orthpoly2(int n, int m, int d1, int d2)
Description not yet available.
void fill_randu(long int &n)
Description not yet available.
double fourth(const double m)
Fourth power of a number; constant objects.
double x
< value of the variable
prevariable(const prevariable &other)
Copy Constructor.
dvar4_array & elem(int i, int j, int k)
int bandwidth(void) const
double log_gamma_density(double x, double r, double mu)
Log gamma probability density function; constant objects.
long int reset_gs_stack(void)
three_array_shape(int sl, int sh)
Stores dimensions for dvar3_array.
int operator>=(const prevariable &v1) const
Description not yet available.
int operator!(void) const
const d4_array & elem(int i) const
predvar_vector(dvar_vector *_p, int _lb, int _ub)
dvector acos(const dvector &vec)
Returns dvector with principal value of the arc cosine of vec, expressed in radians.
void deallocate(void)
Deallocates d3_array memory.
double & operator()(int i, int j, int k, int l, int _m, int _n)
d3_array pow(const d3_array &m, int e)
Description not yet available.
virtual void get_slave_assignments(void)
unsigned int size() const
friend void default_evaluation3ind(void)
Description not yet available.
ad_integer make_ad_integer(int _d)
dvariable robust_regression(const dvector &obs, const dvar_vector &pred, double a=0.7)
Description not yet available.
const dvector & elem(int i, int j, int k, int l) const
virtual int indexmax() const
void read_from(const istream &s)
Description not yet available.
void initialize(void)
Description not yet available.
dvar_matrix use_shape(const dvar_matrix &m)
Description not yet available.
int operator>(const prevariable &v1) const
Description not yet available.
friend void default_evaluation4ind(void)
Description not yet available.
prevariable operator()(int i, int j)
double gamma_deviate(double _x, double _a)
dvar3_array & operator[](int i)
void default_evaluation0(void)
Description not yet available.
dvector asin(const dvector &vec)
Returns dvector with principal value of the arc sine of vec, expressed in radians.
vector_shape(const vector_shape &)=delete
pre_index_type(const index_type *_a, int _i)
Description not yet available.
double fill_seqadd(double, double)
Description not yet available.
void rowfill_randu(const int &i, long int &n)
Fill random numbers into specified row i of matrix.
unsigned int colsize() const
virtual int isdouble(void) const
dvar_matrix & elem(int i, int j)
dvector lower_triagnular_solve_trans(const dmatrix &M, const dvector &y)
void allocate(const lmatrix &dm)
Description not yet available.
virtual int indexmax() const
void rowfill_randu(const int &i, long int &n)
Description not yet available.
const double & elem_value(int i, int j) const
friend dmatrix operator-(const dmatrix &, const dmatrix &)
Description not yet available.