ADMB Documentation  -a65f1c97
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
df3fun.cpp
Go to the documentation of this file.
1 /*
2  * $Id$
3  *
4  * Author: David Fournier
5  * Copyright (c) 2008-2012 Regents of the University of California
6  */
7 
8 #include <df1b2fun.h>
9 //#include "df3fun.h"
11 
16 {
17  v[0] = 0;
18  v[1] = 0;
19  v[2] = 0;
20  v[3] = 0;
21 }
26 {
27  v[0] = x.v[0];
28  v[1] = x.v[1];
29  v[2] = x.v[2];
30  v[3] = x.v[3];
31 }
36 {
37  index_min = m2.index_min;
38  index_max = m2.index_max;
39  shape = m2.shape;
40  if (shape)
41  {
42  (shape->ncopies)++;
43  }
44  v = m2.v;
45 }
48 {
49  deallocate();
50 }
53 {
54  if(shape)
55  {
56  if (shape->ncopies)
57  {
58  (shape->ncopies)--;
59  }
60  else
61  {
63  delete [] v;
64  v = NULL;
65  delete shape;
66  shape=0;
67  index_min = 0;
68  index_max = -1;
69  }
70  }
71 }
72 
74  {
75  int mmin=v.indexmin();
76  int mmax=v.indexmax();
77  dvector cv(mmin,mmax);
78  for (int i=mmin;i<=mmax;i++)
79  {
80  cv(i)=value(v(i));
81  }
82  return cv;
83  }
84 
86  {
87  int mmin=v.indexmin();
88  int mmax=v.indexmax();
89  dvector cv(mmin,mmax);
90  for (int i=mmin;i<=mmax;i++)
91  {
92  cv(i)=*(v(i).get_udot());
93  }
94  return cv;
95  }
96 
98  {
99  int mmin=v.indexmin();
100  int mmax=v.indexmax();
101  dvector cv(mmin,mmax);
102  for (int i=mmin;i<=mmax;i++)
103  {
104  cv(i)=*(v(i).get_udot2());
105  }
106  return cv;
107  }
108 
110  {
111  int mmin=v.indexmin();
112  int mmax=v.indexmax();
113  dvector cv(mmin,mmax);
114  for (int i=mmin;i<=mmax;i++)
115  {
116  cv(i)=*(v(i).get_udot3());
117  }
118  return cv;
119  }
120 
122  {
123  int mmin=indexmin();
124  int mmax=indexmax();
125  for (int i=mmin;i<=mmax;i++)
126  {
127  (*this)(i)=0.0;
128  }
129  }
130 
135 {
136  allocate();
137 }
138 
140  {
141  allocate(min,max);
142  }
143 
152 {
153  index_min = min;
154  index_max = max;
155  v = new df3_one_variable[
156  static_cast<unsigned int>(max < min ? 0 : max - min + 1)];
157  if (v == 0)
158  {
159  cerr << "error allocating memory in df3_one_vector\n";
160  ad_exit(1);
161  }
162  if ((shape = new vector_shapex(min, max, v)) == NULL)
163  {
164  cerr << "Error trying to allocate memory for df3_one_vector\n";
165  ad_exit(1);
166  }
167  v -= min;
168 }
173 {
174  index_min = 0;
175  index_max = -1;
176  v = 0;
177  shape = 0;
178 }
179 
181  {
182  int rmin=v.indexmin();
183  int rmax=v.indexmax();
184  dmatrix cm(rmin,rmax);
185  for (int i=rmin;i<=rmax;i++)
186  {
187  int cmin=v(i).indexmin();
188  int cmax=v(i).indexmax();
189  cm(i).allocate(cmin,cmax);
190  for (int j=cmin;j<=cmax;j++)
191  {
192  cm(i,j)=value(v(i,j));
193  }
194  }
195  return cm;
196  }
197 
199  {
200  int rmin=v.indexmin();
201  int rmax=v.indexmax();
202  dmatrix cm(rmin,rmax);
203  for (int i=rmin;i<=rmax;i++)
204  {
205  int cmin=v(i).indexmin();
206  int cmax=v(i).indexmax();
207  cm(i).allocate(cmin,cmax);
208  cm(i)=first_derivatives(v(i));
209  }
210  return cm;
211  }
212 
214  {
215  int rmin=v.indexmin();
216  int rmax=v.indexmax();
217  dmatrix cm(rmin,rmax);
218  for (int i=rmin;i<=rmax;i++)
219  {
220  int cmin=v(i).indexmin();
221  int cmax=v(i).indexmax();
222  cm(i).allocate(cmin,cmax);
223  cm(i)=second_derivatives(v(i));
224  }
225  return cm;
226  }
227 
229  {
230  int rmin=v.indexmin();
231  int rmax=v.indexmax();
232  dmatrix cm(rmin,rmax);
233  for (int i=rmin;i<=rmax;i++)
234  {
235  int cmin=v(i).indexmin();
236  int cmax=v(i).indexmax();
237  cm(i).allocate(cmin,cmax);
238  cm(i)=third_derivatives(v(i));
239  }
240  return cm;
241  }
242 
243 
245  {
246  index_min=m2.index_min;
247  index_max=m2.index_max;
248  shape=m2.shape;
249  if (shape)
250  {
251  (shape->ncopies)++;
252  }
253  v = m2.v;
254  }
255 
258 {
259  deallocate();
260 }
263 {
264  if (shape)
265  {
266  if (shape->ncopies)
267  {
268  (shape->ncopies)--;
269  }
270  else
271  {
272  v = (df3_one_vector*) (shape->get_pointer());
273  delete [] v;
274  v = nullptr;
275  delete shape;
276  shape = nullptr;
277  index_min = 0;
278  index_max = -1;
279  }
280  }
281 }
282 
284  {
285  int mmin=indexmin();
286  int mmax=indexmax();
287  for (int i=mmin;i<=mmax;i++)
288  {
289  (*this)(i).initialize();
290  }
291  }
292 
293 
294 /*
295 Construct matrix of df3_one_variable with dimension
296 [min to max] x [cmin to cmax].
297 
298 \param rmin lower row index
299 \param rmax upper row index
300 \param cmin lower column index
301 \param cmax upper column index
302 */
303 df3_one_matrix::df3_one_matrix(int rmin, int rmax, int cmin,int cmax)
304 {
305  index_min = rmin;
306  index_max = rmax;
307  v = new df3_one_vector[
308  static_cast<unsigned int>(rmax < rmin ? 0 : rmax - rmin + 1)];
309  if (v == 0)
310  {
311  cerr << "error allocating memory in df3_one_matrix" << endl;
312  ad_exit(1);
313  }
314  if ((shape = new mat_shapex(v)) == NULL)
315  {
316  cerr << "Error trying to allocate memory for df3_one_vector\n";
317  ad_exit(1);
318  }
319  v-=rmin;
320  for (int i = rmin; i<= rmax; ++i)
321  {
322  v[i].allocate(cmin, cmax);
323  }
324 }
325 
326 /*
327  df3_one_variable operator F(const df3_one_variable& x)
328  {
329  df3_one_variable z;
330 
331  *z.get_u() = ::F(*x.get_u());
332 
333  *z.get_udot() = ::D1F(*x.get_u())* *x.get_udot();
334 
335  *z.get_udot2() = ::D2F(*x.get_u())* square(*x.get_udot())
336  + ::D1F(*x.get_u())* *x.get_udot2();
337 
338  *z.get_udot3() = ::D3F(*x.get_u()) * cube(*x.get_udot())
339  + 3.0 * ::D2F(*x.get_u()) * *x.get_udot() * *x.get_udot2()
340  + ::D1F(*x.get_u()) * *x.get_udot3();
341  return z;
342  }
343 
344 */
345 
350 {
351  *get_u() -= d;
352  return *this;
353 }
358 {
359  *get_u() -= *_v.get_u();
360  *get_udot() -= *_v.get_udot();
361  *get_udot2() -= *_v.get_udot2();
362  *get_udot3() -= *_v.get_udot3();
363  return *this;
364 }
365 
367 {
369  *z.get_u() = -(*v.get_u());
370 
371  *z.get_udot() = -(*v.get_udot());
372  *z.get_udot2() = -(*v.get_udot2());
373  *z.get_udot3() = -(*v.get_udot3());
374  return z;
375 }
380 {
381  *get_u() += *_v.get_u();
382  *get_udot() += *_v.get_udot();
383  *get_udot2() += *_v.get_udot2();
384  *get_udot3() += *_v.get_udot3();
385  return *this;
386 }
387 
389  {
391  double u=::sqrt(*x.get_u());
392  double xinv=1.0/(*x.get_u());
393  double zp=0.5/u;
394  double zp2=-0.5*zp*xinv;
395  double zp3=-1.5*zp2*xinv;
396 
397  *z.get_u() = u;
398 
399  *z.get_udot() = zp* *x.get_udot();
400 
401  *z.get_udot2() = zp2 * square(*x.get_udot())
402  + zp * *x.get_udot2();
403 
404  *z.get_udot3() = zp3 * cube(*x.get_udot())
405  + 3.0 * zp2 * *x.get_udot() * *x.get_udot2()
406  + zp * *x.get_udot3();
407 
408  return z;
409  }
410 
411 
412 
414  {
416 
417  *z.get_u() = ::exp(*x.get_u());
418 
419  *z.get_udot() = ::exp(*x.get_u())* *x.get_udot();
420 
421  *z.get_udot2() = ::exp(*x.get_u())* square(*x.get_udot())
422  + ::exp(*x.get_u())* *x.get_udot2();
423 
424  *z.get_udot3() = ::exp(*x.get_u()) * cube(*x.get_udot())
425  + 3.0 * ::exp(*x.get_u()) * *x.get_udot() * *x.get_udot2()
426  + ::exp(*x.get_u()) * *x.get_udot3();
427  return z;
428  }
429 
431  {
433 
434  double xp=1.0/(*x.get_u());
435  double xp2=-square(xp);
436  double xp3=-2.0*xp*xp2;
437 
438  *z.get_u() = ::log(*x.get_u());
439 
440  *z.get_udot() = xp * *x.get_udot();
441 
442  *z.get_udot2() = xp2* square(*x.get_udot())
443  + xp * *x.get_udot2();
444 
445  *z.get_udot3() = xp3 * cube(*x.get_udot())
446  + 3.0 * xp2 * *x.get_udot() * *x.get_udot2()
447  + xp * *x.get_udot3();
448  return z;
449  }
450 
452  {
454  double xinv=1.0/(*x.get_u());
455  double zp=-xinv*xinv;
456  double zp2=-2.0*zp*xinv;
457  double zp3=-3.0*zp2*xinv;
458 
459  *z.get_u() = xinv;
460  *z.get_udot() = zp * *x.get_udot();
461 
462  *z.get_udot2() = zp2 * square(*x.get_udot())
463  + zp * *x.get_udot2();
464 
465  *z.get_udot3() = zp3 * cube(*x.get_udot())
466  + 3.0 * zp2 * *x.get_udot() * *x.get_udot2()
467  + zp * *x.get_udot3();
468 
469  return z;
470  }
471 
473  {
474  *get_u() = *x.get_u();
475  *get_udot() = *x.get_udot();
476  *get_udot2() = *x.get_udot2();
477  *get_udot3() = *x.get_udot3();
478  return *this;
479  }
480 
482  {
483  *get_u() = x;
484  *get_udot() = 0.0;
485  *get_udot2() = 0.0;
486  *get_udot3() = 0.0;
487  return *this;
488  }
489 
490 
492  const df3_one_variable& y)
493  {
495  *z.get_u() = *x.get_u() * *y.get_u();
496  *z.get_udot() = *x.get_u() * *y.get_udot()
497  + *x.get_udot() * *y.get_u();
498 
499  *z.get_udot2() = *x.get_udot2() * *y.get_u()
500  + 2.0 * *x.get_udot() * *y.get_udot()
501  + *x.get_u() * *y.get_udot2();
502 
503  *z.get_udot3() = *x.get_udot3() * *y.get_u()
504  + 3.0 * *x.get_udot2() * *y.get_udot()
505  + 3.0 * *x.get_udot() * *y.get_udot2()
506  + *x.get_u() * *y.get_udot3();
507  return z;
508  }
509 
511  const df3_one_variable& y)
512  {
514  *z.get_u() = x * *y.get_u();
515  *z.get_udot() = x * *y.get_udot();
516 
517  *z.get_udot2() = x * *y.get_udot2();
518 
519  *z.get_udot3() = x * *y.get_udot3();
520  return z;
521  }
522 
524  double y)
525  {
527  *z.get_u() = *x.get_u() * y;
528  *z.get_udot() = *x.get_udot() * y;
529 
530  *z.get_udot2() = *x.get_udot2() * y;
531 
532  *z.get_udot3() = *x.get_udot3() * y;
533  return z;
534  }
535 
536 
538  const df3_one_variable& y)
539  {
540  df3_one_variable u=inv(y);
541  return x*u;
542  }
543 
545  const df3_one_variable& y)
546  {
547  df3_one_variable u=inv(y);
548  return x*u;
549  }
550 
552  {
554  *z.get_u() = x + *y.get_u();
555  *z.get_udot() = *y.get_udot();
556  *z.get_udot2() = *y.get_udot2();
557  *z.get_udot3() = *y.get_udot3();
558  return z;
559  }
560 
561  //
562  // df3_one_variable operator / (const df3_one_variable& x,
563  // const df3_one_variable& y)
564  // {
565  // df3_one_variable z;
566  // double yinv = 1.0 / (*y.get_u());
567  // double yinv2 = yinv * yinv;
568  // double yinv3 = yinv * yinv2;
569  // doubl yd = *y.get_udot();
570  //
571  // //*z.get_u() = *x.get_u() / *y.get_u();
572  // *z.get_u() = *x.get_u() * yinv;
573  //
574  // *z.get_udot() = - (*x.get_u()) * yinv2 * yd
575  // + *x.get_udot() * yinv;
576  //
577  // *z.get_udot2() = *x.get_udot2() * yinv
578  // - 2.0 * *x.get_udot() * yd * yinv2
579  // + 2.0 * *x.get_u() * yinv3 * yd *yd
580  // - *x.get_u() * yinv2 * y.get_udot2();
581  //
582  // *z.get_udot3() = *x.get_udot3() * yinv
583  // + 3.0 * *x.get_udot2() * *y.get_udot()
584  // + 3.0 * *x.get_udot() * *y.get_udot2()
585  // + *x.get_u() * *y.get_udot3();
586  // }
587  //
588 
589 
591  const double x)
592  {
594  *z.get_u() = x + *y.get_u();
595  *z.get_udot() = *y.get_udot();
596  *z.get_udot2() = *y.get_udot2();
597  *z.get_udot3() = *y.get_udot3();
598  return z;
599  }
600 
602  const df3_one_variable& y)
603  {
605  *z.get_u() = *x.get_u() + *y.get_u();
606  *z.get_udot() = *x.get_udot() + *y.get_udot();
607  *z.get_udot2() = *x.get_udot2() + *y.get_udot2();
608  *z.get_udot3() = *x.get_udot3() + *y.get_udot3();
609  return z;
610  }
611 
613  const df3_one_variable& y)
614  {
616  *z.get_u() = *x.get_u() - *y.get_u();
617  *z.get_udot() = *x.get_udot() - *y.get_udot();
618  *z.get_udot2() = *x.get_udot2() - *y.get_udot2();
619  *z.get_udot3() = *x.get_udot3() - *y.get_udot3();
620  return z;
621  }
622 
624  double y)
625  {
627  *z.get_u() = *x.get_u() - y;
628  *z.get_udot() = *x.get_udot();
629  *z.get_udot2() = *x.get_udot2();
630  *z.get_udot3() = *x.get_udot3();
631  return z;
632  }
633 
639 {
641 /*
642  if (num_ind_var>0)
643  {
644  cerr << "can only have 1 independent_variables in df3_one_variable"
645  " function" << endl;
646  ad_exit(1);
647  }
648 */
649  ind_var = &var;
650  *get_u() = *var.get_u();
651  *get_udot() = 1.0;
652  *get_udot2() = 0.0;
653  *get_udot3() = 0.0;
654 }
660 {
661  *get_u() = _u;
662  *get_udot() = 1.0;
663  *get_udot2() = 0.0;
664  *get_udot3() = 0.0;
665 }
666 
668 {
669  // kludge to deal with constantness
670  df3_one_matrix & M= (df3_one_matrix &) MM;
671  int rmin=M.indexmin();
672  int cmin=M(rmin).indexmin();
673  int rmax=M.indexmax();
674  int cmax=M(rmin).indexmax();
675  if (rmin !=1 || cmin !=1)
676  {
677  cerr << "minimum row and column inidices must equal 1 in "
678  "df1b2matrix choleski_decomp(const df3_one_atrix& MM)"
679  << endl;
680  ad_exit(1);
681  }
682  if (rmax !=cmax)
683  {
684  cerr << "Error in df1b2matrix choleski_decomp(const df3_one_matrix& MM)"
685  " Matrix not square" << endl;
686  ad_exit(1);
687  }
688 
689  int n=rmax-rmin+1;
690  df3_one_matrix L(1,n,1,n);
691 #ifndef SAFE_INITIALIZE
692  L.initialize();
693 #endif
694 
695  int i,j,k;
696  df3_one_variable tmp;
697 
698  if (value(M(1,1))<=0)
699  {
700  cerr << "Error matrix not positive definite in choleski_decomp"
701  <<endl;
702  ad_exit(1);
703  }
704 
705  L(1,1)=sqrt(M(1,1));
706  for (i=2;i<=n;i++)
707  {
708  L(i,1)=M(i,1)/L(1,1);
709  }
710 
711  for (i=2;i<=n;i++)
712  {
713  for (j=2;j<=i-1;j++)
714  {
715  tmp=M(i,j);
716  for (k=1;k<=j-1;k++)
717  {
718  tmp-=L(i,k)*L(j,k);
719  }
720  L(i,j)=tmp/L(j,j);
721  }
722  tmp=M(i,i);
723  for (k=1;k<=i-1;k++)
724  {
725  tmp-=L(i,k)*L(i,k);
726  }
727 
728  if (value(tmp)<=0)
729  {
730  cerr << "Error matrix not positive definite in choleski_decomp"
731  <<endl;
732  ad_exit(1);
733  }
734 
735  L(i,i)=sqrt(tmp);
736  }
737 
738  return L;
739 }
740 
742 {
743  int rmin=M.indexmin();
744  int rmax=M.indexmax();
745  if (rmin != indexmin() || rmax != indexmax())
746  {
747  cerr << "unequal shape in "
748  "df1b2matrix& df1b2matrix::operator = (const df3_one_matrix& M)"
749  << endl;
750  ad_exit(1);
751  }
752 
753  for (int i=rmin;i<=rmax;i++)
754  {
755  (*this)(i)=M(i);
756  }
757  return *this;
758 }
759 
761 {
762  int rmin=M.indexmin();
763  int rmax=M.indexmax();
764  if (rmin != indexmin() || rmax != indexmax())
765  {
766  cerr << "unequal shape in "
767  "df1b2vector& df1b2vector::operator = (const df3_one_vector& M)"
768  << endl;
769  ad_exit(1);
770  }
771 
772  for (int i=rmin;i<=rmax;i++)
773  {
774  (*this)(i)=M(i);
775  }
776  return *this;
777 }
778 
780 {
782  //df3_one_variable::ind_var=0;
783  //df1b2variable * px=0;
784  double df= *v.get_udot();
785  double * xd=px->get_u_dot();
786  double * zd=get_u_dot();
787  *get_u()=*v.get_u();
788  for (unsigned int i=0;i<df1b2variable::nvar;i++)
789  {
790  *zd++ = df * *xd++;
791  }
792 
793  /*
794  cout << *v.get_u() << " ";
795  cout << *v.get_udot() << " ";
796  cout << *v.get_udot2() << " ";
797  cout << *v.get_udot3() << endl;
798  */
799  f1b2gradlist->write_pass1(px,this,*v.get_udot(),*v.get_udot2(),
800 
801  *v.get_udot3());
802  return *this;
803 }
804 
805 
807 {
808  df1b2variable z;
810 
811  const double b1=0.319381530;
812  const double b2=-0.356563782;
813  const double b3=1.781477937;
814  const double b4=-1.821255978;
815  const double b5=1.330274429;
816  const double p=.2316419;
817 
818  if (value(x)>=0)
819  {
820  df3_one_variable u1=p*x;
821  df3_one_variable u2=1.+u1;
822  df3_one_variable u=1./u2;
823  df3_one_variable y= ((((b5*u+b4)*u+b3)*u+b2)*u+b1)*u;
824  df3_one_variable tmp1=-0.3989422804*exp(-.5*x*x);
825  z=1.0+tmp1*y;
826  }
827  else
828  {
830  df3_one_variable u=1./(1+p*w);
831  df3_one_variable y= ((((b5*u+b4)*u+b3)*u+b2)*u+b1)*u;
832  df3_one_variable tmp1=0.3989422804*exp(-.5*x*x);
833  z=tmp1*y;
834  }
835  return z;
836 }
837 
839 {
840  df1b2variable z;
842 
843  const double b1=0.319381530;
844  const double b2=-0.356563782;
845  const double b3=1.781477937;
846  const double b4=-1.821255978;
847  const double b5=1.330274429;
848  const double p=.2316419;
849 
850  if (value(x)>=0)
851  {
852  df3_one_variable u1=p*x;
853  df3_one_variable u2=1.+u1;
854  df3_one_variable u=1./u2;
855  df3_one_variable y= ((((b5*u+b4)*u+b3)*u+b2)*u+b1)*u;
856  df3_one_variable tmp1=-0.3989422804*exp(-.5*x*x);
857  z=1.0+tmp1*y;
858  }
859  else
860  {
862  df3_one_variable u=1./(1+p*w);
863  df3_one_variable y= ((((b5*u+b4)*u+b3)*u+b2)*u+b1)*u;
864  df3_one_variable tmp1=0.3989422804*exp(-.5*x*x);
865  z=tmp1*y;
866  }
867  z=beta*(z-0.5)+0.5;
868  return z;
869 }
870 
871 
init_df3_one_variable(const df1b2variable &)
Construct init_df3_one_variable from _var.
Definition: df3fun.cpp:638
int indexmax(void) const
Definition: df3fun.h:123
vector_shapex * shape
Definition: df3fun.h:84
df1b2_gradlist * f1b2gradlist
Definition: df1b2glo.cpp:49
void * trueptr
Address of first element in the vector.
Definition: vector_shapex.h:82
Description not yet available.
Definition: fvar.hpp:2030
double * get_udot3(void) const
Definition: df3fun.h:58
df3_one_vector(void)
Default constructor.
Definition: df3fun.cpp:134
double * get_udot(void) const
Definition: df3fun.h:56
void allocate(void)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Definition: dmat0.cpp:8
void allocate(void)
Does NOT allocate, but initializes empty df3_one_vector.
Definition: df3fun.cpp:172
df1b2variable & operator=(const df3_one_variable &v)
Definition: df3fun.cpp:779
int index_max
Definition: df3fun.h:83
double * get_u() const
Definition: df1b2fun.h:228
mat_shapex * shape
Definition: df3fun.h:119
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).
Definition: d3arr2a.cpp:152
double bounded_cumd_norm(const double x, double beta)
Description not yet available.
Definition: cumdist.cpp:119
#define x
#define ADUNCONST(type, obj)
Creates a shallow copy of obj that is not CONST.
Definition: fvar.hpp:140
Vector of double precision numbers.
Definition: dvector.h:50
int indexmin(void) const
Definition: df1b2fun.h:1054
df3_one_variable * v
Definition: df3fun.h:85
Description not yet available.
Definition: df1b2fun.h:953
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).
Definition: d3arr2a.cpp:132
exitptr ad_exit
Definition: gradstrc.cpp:53
int indexmin(void) const
Definition: df1b2fun.h:969
int index_max
Definition: df3fun.h:118
d3_array cube(const d3_array &m)
Description not yet available.
Definition: d3arr5.cpp:17
double * get_udot2(void) const
Definition: df3fun.h:57
int indexmin(void) const
Definition: df3fun.h:87
df3_one_matrix(int rmin, int rmax, int cmin, int cmax)
Definition: df3fun.cpp:303
~df3_one_matrix()
Destructor.
Definition: df3fun.cpp:257
Description not yet available.
Definition: df1b2fun.h:266
df1b2matrix & operator=(const df3_one_matrix &)
Definition: df3fun.cpp:741
df1_one_matrix choleski_decomp(const df1_one_matrix &MM)
Definition: df11fun.cpp:606
dmatrix operator*(const d3_array &t, const dvector &v)
Description not yet available.
Definition: d3arr12.cpp:17
double * get_u_dot() const
Definition: df1b2fun.h:229
void * get_pointer(void)
Definition: fvar.hpp:2046
double * get_u(void) const
Definition: df3fun.h:55
df1b2vector & operator=(const df3_one_vector &)
Definition: df3fun.cpp:760
prnstream & endl(prnstream &)
df3_one_variable & operator+=(const df3_one_variable &v)
Subtract v values from df3_one_variable u, udot, udot2 and udot3.
Definition: df3fun.cpp:379
~df3_one_vector()
Destructor.
Definition: df3fun.cpp:47
d3_array sqrt(const d3_array &arr3)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Definition: d3arr2c.cpp:11
double var(const dvector &vec)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Definition: cranfill.cpp:23
#define min(a, b)
Definition: cbivnorm.cpp:188
void initialize(void)
Definition: df3fun.cpp:283
dmatrix second_derivatives(const df1_one_matrix &v)
d3_array exp(const d3_array &arr3)
Returns d3_array results with computed exp from elements in arr3.
Definition: d3arr2a.cpp:28
#define M
Definition: rngen.cpp:57
dvariable beta(const prevariable &a, const prevariable &b)
Beta density function.
Definition: vbeta.cpp:18
dvector first_derivatives(const df1_one_vector &v)
Description not yet available.
Definition: df11fun.cpp:399
Description not yet available.
Definition: fvar.hpp:2819
unsigned int ncopies
Copy counter to enable shallow copies.
Definition: vector_shapex.h:79
df3_one_vector * v
Definition: df3fun.h:120
unsigned int ncopies
Definition: fvar.hpp:2034
int write_pass1(const df1b2variable *px, const df1b2variable *py, df1b2variable *pz, df1b2function2 *pf)
Description not yet available.
Definition: df1b2f12.cpp:17
Holds &quot;shape&quot; information for vector objects.
Definition: vector_shapex.h:46
int index_min
Definition: df3fun.h:117
Description not yet available.
Definition: df1b2fun.h:1042
int indexmax(void) const
Definition: df3fun.h:88
static unsigned int nvar
Definition: df1b2fun.h:290
#define w
int indexmax(void) const
Definition: df1b2fun.h:970
double v[4]
Definition: df3fun.h:48
df3_one_variable()
Default constructor.
Definition: df3fun.cpp:15
int indexmax(void) const
Definition: df1b2fun.h:1055
int index_min
Definition: df3fun.h:82
df3_one_variable & operator=(const df3_one_variable &v)
Definition: df3fun.cpp:472
Description not yet available.
d3_array operator/(const d3_array &m, const double d)
Author: David Fournier.
Definition: d3arr2b.cpp:14
int indexmin(void) const
Definition: df3fun.h:122
dmatrix third_derivatives(const df1_one_matrix &v)
dvector value(const df1_one_vector &v)
Definition: df11fun.cpp:69
void deallocate(void)
Deallocate df3_one_vector, then set to empty.
Definition: df3fun.cpp:52
#define max(a, b)
Definition: cbivnorm.cpp:189
double cumd_norm(const double &x)
Culative normal distribution; constant objects.
Definition: cumdist.cpp:90
df3_one_variable & operator-=(const df3_one_variable &v)
Subtract _v values from df3_one_variable u, udot, udot2 and udot3.
Definition: df3fun.cpp:357
static df1b2variable * ind_var
Definition: df3fun.h:50
void deallocate(void)
Deallocate df3_one_matrix, then set to empty.
Definition: df3fun.cpp:262
void initialize(void)
Definition: df3fun.cpp:121
double square(const double value)
Return square of value; constant object.
Definition: d3arr4.cpp:16
df1_one_variable inv(const df1_one_variable &x)
Definition: df11fun.cpp:384
d3_array log(const d3_array &arr3)
Author: David Fournier Copyright (c) 2008-2012 Regents of the University of California.
Definition: d3arr2a.cpp:13