Sacado Package Browser (Single Doxygen Collection) Version of the Day
Loading...
Searching...
No Matches
Sacado_rad.hpp
Go to the documentation of this file.
1// @HEADER
2// ***********************************************************************
3//
4// Sacado Package
5// Copyright (2006) Sandia Corporation
6//
7// Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
8// the U.S. Government retains certain rights in this software.
9//
10// This library is free software; you can redistribute it and/or modify
11// it under the terms of the GNU Lesser General Public License as
12// published by the Free Software Foundation; either version 2.1 of the
13// License, or (at your option) any later version.
14//
15// This library is distributed in the hope that it will be useful, but
16// WITHOUT ANY WARRANTY; without even the implied warranty of
17// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
18// Lesser General Public License for more details.
19//
20// You should have received a copy of the GNU Lesser General Public
21// License along with this library; if not, write to the Free Software
22// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
23// USA
24// Questions? Contact David M. Gay (dmgay@sandia.gov) or Eric T. Phipps
25// (etphipp@sandia.gov).
26//
27// ***********************************************************************
28// @HEADER
29
30// RAD package (Reverse Automatic Differentiation) --
31// a package specialized for function and gradient evaluations.
32// Written in 2004 by David M. Gay at Sandia National Labs, Albuquerque, NM.
33
34#ifndef SACADO_RAD_H
35#define SACADO_RAD_H
36
37#include <stddef.h>
38#include <Sacado_cmath.hpp>
39
40#include "Sacado_ConfigDefs.h"
41
42#if defined(RAD_DEBUG_BLOCKKEEP) && !defined(HAVE_SACADO_UNINIT)
43#undef RAD_DEBUG_BLOCKKEEP
44#endif
45
46namespace Sacado {
47namespace Radnt { // nontemplated RAD
48
49// -DRAD_NO_USING_STDCC is needed, e.g., with Sun CC 5.7
50#ifndef RAD_NO_USING_STDCC
51 // Bring math functions into scope
52 using std::exp;
53 using std::log;
54 using std::log10;
55 using std::sqrt;
56 using std::cos;
57 using std::sin;
58 using std::tan;
59 using std::acos;
60 using std::asin;
61 using std::atan;
62 using std::cosh;
63 using std::sinh;
64 using std::tanh;
65 using std::abs;
66 using std::fabs;
67 using std::atan2;
68 using std::pow;
69#endif
70
71 class ADvar;
72 class ADvari;
73 class ADvar1;
74 class ADvar2;
75 class ConstADvar;
76 class Derp;
77 class IndepADvar;
78
79 extern ADvari& ADf1(double f, double g, const ADvari &x);
80 extern ADvari& ADf2(double f, double gx, double gy, const ADvari &x, const ADvari &y);
81 extern ADvari& ADfn(double f, int n, const ADvar *x, const double *g);
82
83 struct
84ADmemblock { // We get memory in ADmemblock chunks and never give it back,
85 // but reuse it once computations start anew after call(s) on
86 // ADcontext::Gradcomp() or ADcontext::Weighted_Gradcomp().
88 double memblk[1000];
89 };
90
91 class
92ADcontext { // A singleton class: one instance in radops.c
94 char *Mbase;
95 size_t Mleft;
97 void *new_ADmemblock(size_t);
98 public:
99 ADcontext();
100 void *Memalloc(size_t len);
101 static void Gradcomp(int);
102 static inline void Gradcomp() { Gradcomp(1); }
103 static void Weighted_Gradcomp(int, ADvar**, double*);
104 };
105
106inline void *ADcontext::Memalloc(size_t len) {
107 if (Mleft >= len)
108 return Mbase + (Mleft -= len);
109 return new_ADmemblock(len);
110 }
111
112 class
113CADcontext: public ADcontext {
114 protected:
116 public:
117 friend class ADvar;
118 CADcontext(): ADcontext() { fpval_implies_const = false; }
119 static const double One, negOne;
120 };
121
122 class
123Derp { // one derivative-propagation operation
124 public:
125 friend class ADvarn;
126 static Derp *LastDerp;
128 const double *a;
129 const ADvari *b;
130 const ADvari *c;
131 void *operator new(size_t);
132 void operator delete(void*) {} /*Should never be called.*/
133 inline Derp(){};
134 Derp(const ADvari *);
135 Derp(const double *, const ADvari *);
136 Derp(const double *, const ADvari *, const ADvari *);
137 /* c->aval += a * b->aval; */
138 };
139
140inline Derp::Derp(const ADvari *c1): c(c1) {
141 next = LastDerp;
142 LastDerp = this;
143 }
144
145inline Derp::Derp(const double *a1, const ADvari *c1): a(a1), c(c1) {
146 next = LastDerp;
147 LastDerp = this;
148 }
149
150inline Derp::Derp(const double *a1, const ADvari *b1, const ADvari *c1): a(a1), b(b1), c(c1) {
151 next = LastDerp;
152 LastDerp = this;
153 }
154
155 class
156ADvari { // implementation of an ADvar
157 public:
158 double Val; // result of this operation
159 mutable double aval; // adjoint -- partial of final result w.r.t. this Val
160 void *operator new(size_t len) { return ADvari::adc.Memalloc(len); }
161 void operator delete(void*) {} /*Should never be called.*/
162 inline ADvari(double t): Val(t), aval(0.) {}
163 inline ADvari(double t, double ta): Val(t), aval(ta) {}
164 inline ADvari(): Val(0.), aval(0.) {}
166#ifdef RAD_AUTO_AD_Const
167 friend class ADcontext;
168 friend class ADvar1;
169 friend class ADvar;
170 friend class ConstADvar;
171 friend class IndepADvar;
172 private:
173 ADvari *Next;
174 static ADvari *First_ADvari, **Last_ADvari;
175 protected:
176 IndepADvar *padv;
177 public:
178 ADvari(const IndepADvar *, double);
179#endif
180#define F friend
181#define R ADvari&
182#define Ai const ADvari&
183#define T1(r,f) F r f(Ai);
184#define T2(r,f) \
185F r f(Ai,Ai); \
186F r f(double,Ai); \
187F r f(Ai,double);
188 T1(R,operator+)
189 T2(R,operator+)
190 T1(R,operator-)
191 T2(R,operator-)
192 T2(R,operator*)
193 T2(R,operator/)
194 T1(R,abs)
195 T1(R,acos)
196 T1(R,acosh)
197 T1(R,asin)
198 T1(R,asinh)
199 T1(R,atan)
200 T1(R,atanh)
201 T2(R,atan2)
202 T2(R,max)
203 T2(R,min)
204 T1(R,cos)
205 T1(R,cosh)
206 T1(R,exp)
207 T1(R,log)
208 T1(R,log10)
209 T2(R,pow)
210 T1(R,sin)
211 T1(R,sinh)
212 T1(R,sqrt)
213 T1(R,tan)
214 T1(R,tanh)
215 T1(R,fabs)
216 T1(R,copy)
217 T2(int,operator<)
218 T2(int,operator<=)
219 T2(int,operator==)
220 T2(int,operator!=)
221 T2(int,operator>=)
222 T2(int,operator>)
223#undef T2
224#undef T1
225#undef Ai
226#undef R
227#undef F
228
229 friend ADvari& ADf1(double f, double g, const ADvari &x);
230 friend ADvari& ADf2(double f, double gx, double gy, const ADvari &x, const ADvari &y);
231 friend ADvari& ADfn(double f, int n, const ADvar *x, const double *g);
232 };
233
234 inline void* Derp::operator new(size_t len) { return ADvari::adc.Memalloc(len); }
235
236
237 class
238ADvar1: public ADvari { // simplest unary ops
239 public:
241 ADvar1(double val1): ADvari(val1) {}
242 ADvar1(double val1, const ADvari *c1): d(c1) { Val = val1; }
243 ADvar1(double val1, const double *a1, const ADvari *c1): d(a1,this,c1) { Val = val1; }
244#ifdef RAD_AUTO_AD_Const
245 ADvar1(const IndepADvar *, const IndepADvar &);
246 ADvar1(const IndepADvar *, const ADvari &);
247#endif
248 };
249
250 class
251ConstADvari: public ADvari {
252 private:
254 ConstADvari() {}; // prevent construction without value (?)
256 public:
258 inline void *operator new(size_t len) { return ConstADvari::cadc.Memalloc(len); }
259 inline ConstADvari(double t): ADvari(t) { prevcad = lastcad; lastcad = this; }
260 static void aval_reset(void);
261 };
262
263 class
265{
266 private:
268 /* private to prevent assignment */
269#ifdef RAD_AUTO_AD_Const
270 if (cv)
271 cv->padv = 0;
272 cv = new ADvar1(this,x);
273 return *this;
274#else
275#ifdef RAD_EQ_ALIAS
276 cv = x.cv;
277 return *this;
278#else
279 return ADvar_operatoreq(this,*x.cv);
280#endif
281#endif /* RAD_AUTO_AD_Const */
282 }
283 protected:
284 static void AD_Const(const IndepADvar&);
286 public:
287 typedef double value_type;
288 friend class ADvar;
289 friend class ADvar1;
290 friend class ADvarn;
291 friend class ADcontext;
292 IndepADvar(double);
293 IndepADvar(int);
294 IndepADvar(long);
295 IndepADvar& operator=(double);
296#ifdef RAD_AUTO_AD_Const
297 inline IndepADvar(const IndepADvar &x) { cv = x.cv ? new ADvar1(this, x) : 0; };
298 inline IndepADvar() { cv = 0; }
299 inline ~IndepADvar() {
300 if (cv)
301 cv->padv = 0;
302 }
303#else
304 inline IndepADvar() {
305#ifndef RAD_EQ_ALIAS
306 cv = 0;
307#endif
308 }
309 inline ~IndepADvar() {}
311#endif
312
313 friend void AD_Const(const IndepADvar&);
314
315 inline operator ADvari&() { return *cv; }
316 inline operator ADvari&() const { return *(ADvari*)cv; }
317
318 inline double val() const { return cv->Val; }
319 inline double adj() const { return cv->aval; }
320 static inline void Gradcomp(int wantgrad)
321 { ADcontext::Gradcomp(wantgrad); }
322 static inline void Gradcomp()
323 { ADcontext::Gradcomp(1); }
324 static inline void aval_reset() { ConstADvari::aval_reset(); }
325 static inline void Weighted_Gradcomp(int n, ADvar **v, double *w)
326 { ADcontext::Weighted_Gradcomp(n, v, w); }
327
328
329#define Ai const ADvari&
330#define AI const IndepADvar&
331#define T2(r,f) \
332 r f(AI,AI);\
333 r f(Ai,AI);\
334 r f(AI,Ai);\
335 r f(double,AI);\
336 r f(AI,double);
337#define T1(f) friend ADvari& f(AI);
338
339#define F friend ADvari&
340T2(F, operator+)
341T2(F, operator-)
342T2(F, operator*)
343T2(F, operator/)
344T2(F, atan2)
345T2(F, max)
346T2(F, min)
347T2(F, pow)
348#undef F
349#define F friend int
350T2(F, operator<)
351T2(F, operator<=)
352T2(F, operator==)
353T2(F, operator!=)
354T2(F, operator>=)
355T2(F, operator>)
356
357T1(operator+)
358T1(operator-)
359T1(abs)
360T1(acos)
361T1(acosh)
362T1(asin)
363T1(asinh)
364T1(atan)
365T1(atanh)
366T1(cos)
367T1(cosh)
368T1(exp)
369T1(log)
370T1(log10)
371T1(sin)
372T1(sinh)
373T1(sqrt)
374T1(tan)
375T1(tanh)
376T1(fabs)
377T1(copy)
378
379#undef T1
380#undef T2
381#undef F
382#undef Ai
383#undef AI
384
385 };
386
387 class
388ADvar: public IndepADvar { // an "active" variable
389 void ADvar_ctr(double d);
390 public:
391 inline ADvar() { /* cv = 0; */ }
392 inline ADvar(double d) { ADvar_ctr(d); }
393 inline ADvar(int i) { ADvar_ctr((double)i); }
394 inline ADvar(long i) { ADvar_ctr((double)i); }
395 inline ~ADvar() {}
396#ifdef RAD_AUTO_AD_Const
397 friend class ADvar1;
398 inline ADvar(const IndepADvar &x) { cv = x.cv ? new ADvar1(this, x) : 0; }
399 inline ADvar(ADvari &x) { cv = &x; x.padv = this; }
400 inline ADvar& operator=(const IndepADvar &x) {
401 if (cv)
402 cv->padv = 0;
403 cv = new ADvar1(this,x);
404 return *this;
405 }
406 inline ADvar& operator=(const ADvari &x) {
407 if (cv)
408 cv->padv = 0;
409 cv = new ADvar1(this, x);
410 return *this;
411 }
412#else
413 friend ADvar& ADvar_operatoreq(ADvar*, const ADvari&);
414#ifdef RAD_EQ_ALIAS
415 /* allow aliasing v and w after "v = w;" */
416 inline ADvar(const IndepADvar &x) { cv = x.cv; }
417 inline ADvar(const ADvari &x) { cv = (ADvari*)&x; }
418 inline ADvar& operator=(const ADvari &x) { cv = (ADvari*)&x; return *this; }
419 inline ADvar& operator=(const IndepADvar &x) { cv = (ADvari*)x.cv; return *this; }
420#else
421 ADvar(const IndepADvar &x) { cv = x.cv ? new ADvar1(x.cv->Val, &CADcontext::One, x.cv) : 0; }
422 ADvar(const ADvari &x) { cv = new ADvar1(x.Val, &CADcontext::One, &x); }
423 inline ADvar& operator=(const ADvari &x) { return ADvar_operatoreq(this,x); }
424 inline ADvar& operator=(const IndepADvar &x) { return ADvar_operatoreq(this,*x.cv); }
425#endif /* RAD_EQ_ALIAS */
426#endif /* RAD_AUTO_AD_Const */
427 ADvar& operator=(double);
428 ADvar& operator+=(const ADvari&);
429 ADvar& operator+=(double);
430 ADvar& operator-=(const ADvari&);
431 ADvar& operator-=(double);
432 ADvar& operator*=(const ADvari&);
433 ADvar& operator*=(double);
434 ADvar& operator/=(const ADvari&);
435 ADvar& operator/=(double);
436 inline static bool get_fpval_implies_const(void)
438 inline static void set_fpval_implies_const(bool newval)
440 inline static bool setget_fpval_implies_const(bool newval) {
443 return oldval;
444 }
445 static inline void Gradcomp(int wantgrad)
446 { ADcontext::Gradcomp(wantgrad); }
447 static inline void Gradcomp()
448 { ADcontext::Gradcomp(1); }
449 static inline void aval_reset() { ConstADvari::aval_reset(); }
450 static inline void Weighted_Gradcomp(int n, ADvar **v, double *w)
451 { ADcontext::Weighted_Gradcomp(n, v, w); }
452 };
453
454 inline void AD_Const(const IndepADvar&v) { IndepADvar::AD_Const(v); }
455
456 class
457ConstADvar: public ADvar {
458 private: // disable op=
467 void ConstADvar_ctr(double);
468 public:
469 inline ConstADvar(double d) { ConstADvar_ctr(d); }
470 inline ConstADvar(int i) { ConstADvar_ctr((double)i); }
471 inline ConstADvar(long i) { ConstADvar_ctr((double)i); }
472 ConstADvar(const ADvari &x);
473#ifdef RAD_AUTO_AD_Const
474 ConstADvar(const IndepADvar &x) { cv = new ADvar1(this,x); }
475#endif
476 inline ~ConstADvar(){}
477#ifdef RAD_NO_CONST_UPDATE
478 private:
479#endif
480 ConstADvar();
481 inline ConstADvar& operator=(double d) { cv->Val = d; return *this; }
482 inline ConstADvar& operator=(const IndepADvar& d) { cv->Val = d.val(); return *this; }
483 };
484
485 class
486ADvar1s: public ADvar1 { // unary ops with partial "a"
487 public:
488 double a;
489 ADvar1s(double val1, double a1, const ADvari *c1): ADvar1(val1,&a,c1), a(a1) {}
490 };
491
492 class
493ADvar2: public ADvari { // basic binary ops
494 public:
495 Derp dL, dR;
496 ADvar2(double val1): ADvari(val1) {}
497 ADvar2(double val1, const ADvari *Lcv, const double *Lc, const ADvari *Rcv,
498 const double *Rc): ADvari(val1) {
499 dR.next = Derp::LastDerp;
500 dL.next = &dR;
501 Derp::LastDerp = &dL;
502 dL.a = Lc;
503 dL.c = Lcv;
504 dR.a = Rc;
505 dR.c = Rcv;
506 dL.b = dR.b = this;
507 }
508 };
509
510 class
511ADvar2q: public ADvar2 { // binary ops with partials "a", "b"
512 public:
513 double a, b;
514 ADvar2q(double val1, double Lp, double Rp, const ADvari *Lcv, const ADvari *Rcv):
515 ADvar2(val1), a(Lp), b(Rp) {
516 dR.next = Derp::LastDerp;
517 dL.next = &dR;
518 Derp::LastDerp = &dL;
519 dL.a = &a;
520 dL.c = Lcv;
521 dR.a = &b;
522 dR.c = Rcv;
523 dL.b = dR.b = this;
524 }
525 };
526
527 class
528ADvarn: public ADvari { // n-ary ops with partials "a"
529 public:
530 int n;
531 double *a;
533 ADvarn(double val1, int n1, const ADvar *x, const double *g);
534 };
535
536inline ADvari &operator+(ADvari &T) { return T; }
537inline ADvari &operator+(const ADvari &T) { return (ADvari&) T; }
538
539inline int operator<(const ADvari &L, const ADvari &R) { return L.Val < R.Val; }
540inline int operator<(const ADvari &L, double R) { return L.Val < R; }
541inline int operator<(double L, const ADvari &R) { return L < R.Val; }
542
543inline int operator<=(const ADvari &L, const ADvari &R) { return L.Val <= R.Val; }
544inline int operator<=(const ADvari &L, double R) { return L.Val <= R; }
545inline int operator<=(double L, const ADvari &R) { return L <= R.Val; }
546
547inline int operator==(const ADvari &L, const ADvari &R) { return L.Val == R.Val; }
548inline int operator==(const ADvari &L, double R) { return L.Val == R; }
549inline int operator==(double L, const ADvari &R) { return L == R.Val; }
550
551inline int operator!=(const ADvari &L, const ADvari &R) { return L.Val != R.Val; }
552inline int operator!=(const ADvari &L, double R) { return L.Val != R; }
553inline int operator!=(double L, const ADvari &R) { return L != R.Val; }
554
555inline int operator>=(const ADvari &L, const ADvari &R) { return L.Val >= R.Val; }
556inline int operator>=(const ADvari &L, double R) { return L.Val >= R; }
557inline int operator>=(double L, const ADvari &R) { return L >= R.Val; }
558
559inline int operator>(const ADvari &L, const ADvari &R) { return L.Val > R.Val; }
560inline int operator>(const ADvari &L, double R) { return L.Val > R; }
561inline int operator>(double L, const ADvari &R) { return L > R.Val; }
562
563inline ADvari& copy(const IndepADvar &x)
564{ return *(new ADvar1(x.cv->Val, &CADcontext::One, x.cv)); }
565
566inline ADvari& copy(const ADvari &x)
567{ return *(new ADvar1(x.Val, &CADcontext::One, &x)); }
568
569inline ADvari& abs(const ADvari &x)
570{ return fabs(x); }
571
572#define A (ADvari*)
573#define T inline
574#define F ADvari&
575#define Ai const ADvari&
576#define AI const IndepADvar&
577#define D double
578#define T2(r,f) \
579 T r f(Ai L, AI R) { return f(L, *A R.cv); }\
580 T r f(AI L, Ai R) { return f(*A L.cv, R); }\
581 T r f(AI L, AI R) { return f(*A L.cv, *A R.cv); }\
582 T r f(AI L, D R) { return f(*A L.cv, R); }\
583 T r f(D L, AI R) { return f(L, *A R.cv); }
584
585T2(F, operator+)
586T2(F, operator-)
587T2(F, operator*)
588T2(F, operator/)
589T2(F, atan2)
590T2(F, pow)
591T2(F, max)
592T2(F, min)
593T2(int, operator<)
594T2(int, operator<=)
595T2(int, operator==)
596T2(int, operator!=)
597T2(int, operator>=)
598T2(int, operator>)
599
600#undef T2
601#undef D
602
603#define T1(f)\
604 T F f(AI x) { return f(*A x.cv); }
605
606T1(operator+)
607T1(operator-)
608T1(abs)
609T1(acos)
610T1(acosh)
611T1(asin)
612T1(asinh)
613T1(atan)
614T1(atanh)
615T1(cos)
616T1(cosh)
617T1(exp)
618T1(log)
619T1(log10)
620T1(sin)
621T1(sinh)
622T1(sqrt)
623T1(tan)
624T1(tanh)
625T1(fabs)
626
627#undef T1
628#undef AI
629#undef Ai
630#undef F
631#undef T
632#undef A
633
634} // namespace Radnt
635} // namespace Sacado
636#endif /* SACADO_RAD_H */
fabs(expr.val())
abs(expr.val())
expr expr1 expr1 expr1 c expr2 expr1 expr2 expr1 expr2 expr1 expr1 expr1 expr1 c expr2 expr1 expr2 expr1 expr2 expr1 expr1 expr1 expr1 c *expr2 expr1 expr2 expr1 expr2 expr1 expr1 expr1 expr1 c expr2 expr1 expr2 expr1 expr2 expr1 expr1 expr1 expr2 expr1 expr2 expr1 expr1 expr1 expr2 expr1 expr2 expr1 expr1 expr1 c
#define T
Definition: Sacado_rad.hpp:573
#define T1(r, f)
Definition: Sacado_rad.hpp:603
#define R
Definition: Sacado_rad.hpp:181
#define T2(r, f)
Definition: Sacado_rad.hpp:578
void * Memalloc(size_t len)
Definition: Sacado_rad.hpp:106
void * new_ADmemblock(size_t)
static void Weighted_Gradcomp(int, ADvar **, double *)
ADvar1(double val1, const double *a1, const ADvari *c1)
Definition: Sacado_rad.hpp:243
ADvar1(double val1, const ADvari *c1)
Definition: Sacado_rad.hpp:242
ADvar1s(double val1, double a1, const ADvari *c1)
Definition: Sacado_rad.hpp:489
ADvar2(double val1, const ADvari *Lcv, const double *Lc, const ADvari *Rcv, const double *Rc)
Definition: Sacado_rad.hpp:497
ADvar2q(double val1, double Lp, double Rp, const ADvari *Lcv, const ADvari *Rcv)
Definition: Sacado_rad.hpp:514
static void Gradcomp()
Definition: Sacado_rad.hpp:447
ADvar(const ADvari &x)
Definition: Sacado_rad.hpp:422
static void aval_reset()
Definition: Sacado_rad.hpp:449
static bool setget_fpval_implies_const(bool newval)
Definition: Sacado_rad.hpp:440
ADvar & operator=(const IndepADvar &x)
Definition: Sacado_rad.hpp:424
ADvar(const IndepADvar &x)
Definition: Sacado_rad.hpp:421
ADvar & operator=(const ADvari &x)
Definition: Sacado_rad.hpp:423
static void Gradcomp(int wantgrad)
Definition: Sacado_rad.hpp:445
static void set_fpval_implies_const(bool newval)
Definition: Sacado_rad.hpp:438
static void Weighted_Gradcomp(int n, ADvar **v, double *w)
Definition: Sacado_rad.hpp:450
static bool get_fpval_implies_const(void)
Definition: Sacado_rad.hpp:436
static ADcontext adc
Definition: Sacado_rad.hpp:165
ADvari(double t, double ta)
Definition: Sacado_rad.hpp:163
static const double One
Definition: Sacado_rad.hpp:119
static const double negOne
Definition: Sacado_rad.hpp:119
ConstADvar & operator*=(const ADvari &)
ConstADvar & operator/=(const ADvari &)
ConstADvar & operator=(double d)
Definition: Sacado_rad.hpp:481
ConstADvar & operator+=(const ADvari &)
ConstADvar & operator+=(double)
ConstADvar & operator/=(double)
ConstADvar & operator*=(double)
ConstADvar & operator-=(const ADvari &)
ConstADvar & operator-=(double)
ConstADvar & operator=(const IndepADvar &d)
Definition: Sacado_rad.hpp:482
static void aval_reset(void)
static ConstADvari * lastcad
Definition: Sacado_rad.hpp:255
static CADcontext cadc
Definition: Sacado_rad.hpp:257
const double * a
Definition: Sacado_rad.hpp:128
static Derp * LastDerp
Definition: Sacado_rad.hpp:126
const ADvari * c
Definition: Sacado_rad.hpp:130
const ADvari * b
Definition: Sacado_rad.hpp:129
static void Gradcomp(int wantgrad)
Definition: Sacado_rad.hpp:320
IndepADvar & operator=(const IndepADvar &x)
Definition: Sacado_rad.hpp:267
friend void AD_Const(const IndepADvar &)
Definition: Sacado_rad.hpp:454
static void Weighted_Gradcomp(int n, ADvar **v, double *w)
Definition: Sacado_rad.hpp:325
const double y
int operator<=(const ADvari &L, const ADvari &R)
Definition: Sacado_rad.hpp:543
ADvari & ADfn(double f, int n, const ADvar *x, const double *g)
int operator<(const ADvari &L, const ADvari &R)
Definition: Sacado_rad.hpp:539
ADvari & ADf2(double f, double gx, double gy, const ADvari &x, const ADvari &y)
void AD_Const(const IndepADvar &v)
Definition: Sacado_rad.hpp:454
int operator!=(const ADvari &L, const ADvari &R)
Definition: Sacado_rad.hpp:551
ADvari & ADf1(double f, double g, const ADvari &x)
ADvari & operator+(ADvari &T)
Definition: Sacado_rad.hpp:536
int operator>=(const ADvari &L, const ADvari &R)
Definition: Sacado_rad.hpp:555
ADvar & ADvar_operatoreq(ADvar *This, const ADvari &x)
int operator==(const ADvari &L, const ADvari &R)
Definition: Sacado_rad.hpp:547
ADvari & copy(const IndepADvar &x)
Definition: Sacado_rad.hpp:563
int operator>(const ADvari &L, const ADvari &R)
Definition: Sacado_rad.hpp:559