79 cerr <<
"Incompatible array bounds in function "
80 "dvar_vector log_comb(const dvar_vector& n, const dvector& r)" <<
endl;
84 for (
int i=mmin;i<=mmax;i++)
106 cerr <<
"Incompatible array bounds in function "
107 "dvar_vector log_comb(const dvar_vector& n, const dvector& r)" <<
endl;
111 for (
int i=mmin;i<=mmax;i++)
133 cerr <<
"Incompatible array bounds in function "
134 "dvar_vector log_comb(const dvar_vector& n, const dvector& r)" <<
endl;
138 for (
int i=mmin;i<=mmax;i++)
159 for (
int i=mmin;i<=mmax;i++)
180 for (
int i=mmin;i<=mmax;i++)
200 for (
int i=mmin;i<=mmax;i++)
221 for (
int i=mmin;i<=mmax;i++)
241 for (
int i=mmin;i<=mmax;i++)
251 double z =
value(_z);
255 const double lpp =0.9189385332046727417803297;
257 const double c[9]={0.99999999999980993,
263 -0.13857109526572012,
264 9.9843695780195716e-6,
265 1.5056327351493116e-7};
269 for (
int i=1;i<=n+1;i++)
271 double zinv=1.0/(z+i);
278 double ans= lpp + (z+0.5)*
log(t) -t +
log(x);
283 double ansdot=
log(t) + (z+0.5)/t -1.0 +xdot/
x;
287 &(u.
v->
x), &(_z.
v->
x), ansdot );
293 const double lpi =1.1447298858494001741434272;
294 const double pi =3.1415926535897932384626432;
Base class for dvariable.
double factln(double n)
Log-factorial .
double log_comb(double n, double k)
Log of the binomial coefficent; i.e log of 'n choose k'.
double gammln(double xx)
Log gamma function.
Vector of double precision numbers.
int indexmin() const
Get minimum valid index.
d3_array sin(const d3_array &arr3)
Returns d3_array results with computed sin from elements in arr3.
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.
prnstream & endl(prnstream &)
void RETURN_ARRAYS_INCREMENT()
int indexmax() const
Get maximum valid index.
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
void default_evaluation(void)
Description not yet available.
static _THREAD gradient_structure * _instance
double_and_int * v
pointer to the data
void RETURN_ARRAYS_DECREMENT()
dvector value(const df1_one_vector &v)
static dvariable gammlnguts(const prevariable &_z)
static _THREAD grad_stack * GRAD_STACK1
class for things related to the gradient structures, including dimension of arrays, size of buffers, etc.
double square(const double value)
Return square of value; constant object.
Fundamental data type for reverse mode automatic differentiation.
d3_array log(const d3_array &arr3)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
double x
< value of the variable