ad.hpp Source File

CPP API: ad.hpp Source File
ad.hpp
Go to the documentation of this file.
1 /*---------------------------------------------------------------------------*\
2  * Algorithmic Differentiation by Overloading in C++
3  Copyright (C) 2021 Software and Tools for Computational Engineering (STCE)
4  RWTH Aachen University www.stce.rwth-aachen.de
5 \*---------------------------------------------------------------------------*/
6 /*---------------------------------------------------------------------------*\
7 *
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
11 *
12 * http://www.apache.org/licenses/LICENSE-2.0
13 *
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 */
20 
21 #pragma once
22 
23 #ifndef AD_HPP
24 #define AD_HPP
25 
26 #define AD_VERSION_SHORT "AD v1.0"
27 
28 #include <sstream>
29 #include <cmath>
30 #include <vector>
31 #include <iostream>
32 #include <map>
33 #include <fstream>
34 #include <complex>
35 #include <string>
36 #include <stack>
37 #include <exception>
38 #include <stdexcept>
39 #include <string>
40 #include <bitset>
41 #include <cstdarg>
42 #include <cstdlib>
43 #include <cstdio>
44 #include <string.h>
45 
46 #include <cassert>
47 #include <limits>
48 #include <iomanip>
49 
50 #if !defined(_WIN32)
51 #include <unistd.h>
52 #include <sys/mman.h>
53 #include <sys/time.h>
54 #endif
55 
56 #if !defined(AD_DOXYGEN) & defined(_WIN32)
57 
58 #ifndef NOMINMAX
59 #define NOMINMAX
60 #endif
61 
62 #include <windows.h>
63 #include <algorithm>
64 
65 #endif
66 
67 // for stce::timer
68 
69 #include <fcntl.h>
70 #include <typeinfo>
71 
72 // define all DEPRECATED, to generate compiler-warnings,
73 // if a marked function is instantiated
74 // (only implemented for gnu compiler and visual C++)
75 #ifdef __GNUC__
76 #define DEPRECATED __attribute__((deprecated))
77 #else
78 // #pragma message("WARNING: You need to implement DEPRECATED for this compiler")
79 #define DEPRECATED
80 #endif
81 
82 #ifndef AD_DEFAULT_TAPE_SIZE
83 #define AD_DEFAULT_TAPE_SIZE 1024*1024*10
84 #endif
85 
86 #define ADi_INLINEDEF inline
87 
88 typedef long int AD_TAPE_INT;
89 #define ADi_BASE_TYPE double
90 
91 #ifdef AD_DEBUG
92 # ifndef AD_TAPE_BOUNDS_CHECK
93 # define AD_TAPE_BOUNDS_CHECK
94 # endif
95 # define CHECK_OVERFLOW(x, a) assert(x < static_cast<AD_TAPE_INT>(std::numeric_limits<AD_TAPE_INT>::max()-a))
96 #else
97 # define CHECK_OVERFLOW(x, a)
98 #endif
99 
100 // this macro enables a constructor to the type passed as argument
101 namespace ad {
102 template <typename T,typename T2=T>
103  struct ad_type_constructable_from { const static bool value = false; };
104 }
105 
106 #define AD_ENABLE_TYPE_CONSTRUCTION_FROM(T) \
107  namespace ad { \
108  template <typename T2> \
109  struct ad_type_constructable_from<T,T2> { \
110  const static bool value = true; \
111  typedef T2 type; \
112  }; \
113  }
114 
115 typedef long int AD_TAPE_INT;
116 namespace ad {
117  namespace operations {
118  template<class AD_TAPE_REAL>struct ad_add_aa {
119  template<class T1, class T2>static inline const AD_TAPE_REAL eval (const T1 &arg1, const T2 &arg2) {
120  return arg1._value() + arg2._value();
121  } template<class T1,class T2>static inline const AD_TAPE_REAL calc_partial1(const AD_TAPE_REAL &_value, const T1 &arg1, const T2 &arg2 ) {
122  (void) _value;
123  (void)arg1;
124  (void)arg2;
125  return 1.0;
126  } template<class T1,class T2>static inline const AD_TAPE_REAL calc_partial2(const AD_TAPE_REAL &_value, const T1 &arg1, const T2 &arg2 ) {
127  (void) _value;
128  (void)arg1;
129  (void)arg2;
130  return 1.0;
131  }
132  };
133  template<class AD_TAPE_REAL>struct ad_sub_aa {
134  template<class T1, class T2>static inline const AD_TAPE_REAL eval (const T1 &arg1, const T2 &arg2) {
135  return arg1._value() - arg2._value();
136  } template<class T1,class T2>static inline const AD_TAPE_REAL calc_partial1(const AD_TAPE_REAL &_value, const T1 &arg1, const T2 &arg2 ) {
137  (void) _value;
138  (void)arg1;
139  (void)arg2;
140  return 1.0;
141  } template<class T1,class T2>static inline const AD_TAPE_REAL calc_partial2(const AD_TAPE_REAL &_value, const T1 &arg1, const T2 &arg2 ) {
142  (void) _value;
143  (void)arg1;
144  (void)arg2;
145  return -1.0;
146  }
147  };
148  template<class AD_TAPE_REAL>struct ad_mul_aa {
149  template<class T1, class T2>static inline const AD_TAPE_REAL eval (const T1 &arg1, const T2 &arg2) {
150  return arg1._value() * arg2._value();
151  } template<class T1,class T2>static inline const AD_TAPE_REAL calc_partial1(const AD_TAPE_REAL &_value, const T1 &arg1, const T2 &arg2 ) {
152  (void) _value;
153  (void)arg1;
154  (void)arg2;
155  return arg2._value();
156  } template<class T1,class T2>static inline const AD_TAPE_REAL calc_partial2(const AD_TAPE_REAL &_value, const T1 &arg1, const T2 &arg2 ) {
157  (void) _value;
158  (void)arg1;
159  (void)arg2;
160  return arg1._value();
161  }
162  };
163  template<class AD_TAPE_REAL>struct ad_div_aa {
164  template<class T1, class T2>static inline const AD_TAPE_REAL eval (const T1 &arg1, const T2 &arg2) {
165  return arg1._value() / arg2._value();
166  } template<class T1,class T2>static inline const AD_TAPE_REAL calc_partial1(const AD_TAPE_REAL &_value, const T1 &arg1, const T2 &arg2 ) {
167  (void) _value;
168  (void)arg1;
169  (void)arg2;
170  return 1.0 / arg2._value();
171  } template<class T1,class T2>static inline const AD_TAPE_REAL calc_partial2(const AD_TAPE_REAL &_value, const T1 &arg1, const T2 &arg2 ) {
172  (void) _value;
173  (void)arg1;
174  (void)arg2;
175  return -_value / arg2._value();
176  }
177  };
178  template<class AD_TAPE_REAL>struct ad_add_ap {
179  template<class T1>static inline const AD_TAPE_REAL eval(const T1 &arg1, const AD_TAPE_REAL &arg2) {
180  return arg1._value() + arg2;
181  } template<class T1>static inline const AD_TAPE_REAL calc_partial1(const AD_TAPE_REAL &_value, const T1 &arg1, const AD_TAPE_REAL &arg2 ) {
182  (void)_value;
183  (void)arg1;
184  (void)arg2;
185  return 1.0;
186  }
187  };
188  template<class AD_TAPE_REAL>struct ad_add_pa {
189  template<class T2>static inline const AD_TAPE_REAL eval(const AD_TAPE_REAL &arg1, const T2 &arg2) {
190  return arg1 + arg2._value();
191  } template<class T2>static inline const AD_TAPE_REAL calc_partial2(const AD_TAPE_REAL &_value, const AD_TAPE_REAL &arg1, const T2 &arg2 ) {
192  (void) _value;
193  (void)arg1;
194  (void)arg2;
195  return 1.0;
196  }
197  };
198  template<class AD_TAPE_REAL>struct ad_sub_ap {
199  template<class T1>static inline const AD_TAPE_REAL eval(const T1 &arg1, const AD_TAPE_REAL &arg2) {
200  return arg1._value() - arg2;
201  } template<class T1>static inline const AD_TAPE_REAL calc_partial1(const AD_TAPE_REAL &_value, const T1 &arg1, const AD_TAPE_REAL &arg2 ) {
202  (void)_value;
203  (void)arg1;
204  (void)arg2;
205  return 1.0;
206  }
207  };
208  template<class AD_TAPE_REAL>struct ad_sub_pa {
209  template<class T2>static inline const AD_TAPE_REAL eval(const AD_TAPE_REAL &arg1, const T2 &arg2) {
210  return arg1 - arg2._value();
211  } template<class T2>static inline const AD_TAPE_REAL calc_partial2(const AD_TAPE_REAL &_value, const AD_TAPE_REAL &arg1, const T2 &arg2 ) {
212  (void) _value;
213  (void)arg1;
214  (void)arg2;
215  return -1.0;
216  }
217  };
218  template<class AD_TAPE_REAL>struct ad_mul_ap {
219  template<class T1>static inline const AD_TAPE_REAL eval(const T1 &arg1, const AD_TAPE_REAL &arg2) {
220  return arg1._value() * arg2;
221  } template<class T1>static inline const AD_TAPE_REAL calc_partial1(const AD_TAPE_REAL &_value, const T1 &arg1, const AD_TAPE_REAL &arg2 ) {
222  (void)_value;
223  (void)arg1;
224  (void)arg2;
225  return arg2;
226  }
227  };
228  template<class AD_TAPE_REAL>struct ad_mul_pa {
229  template<class T2>static inline const AD_TAPE_REAL eval(const AD_TAPE_REAL &arg1, const T2 &arg2) {
230  return arg1 * arg2._value();
231  } template<class T2>static inline const AD_TAPE_REAL calc_partial2(const AD_TAPE_REAL &_value, const AD_TAPE_REAL &arg1, const T2 &arg2 ) {
232  (void) _value;
233  (void)arg1;
234  (void)arg2;
235  return arg1;
236  }
237  };
238  template<class AD_TAPE_REAL>struct ad_div_ap {
239  template<class T1>static inline const AD_TAPE_REAL eval(const T1 &arg1, const AD_TAPE_REAL &arg2) {
240  return arg1._value() / arg2;
241  } template<class T1>static inline const AD_TAPE_REAL calc_partial1(const AD_TAPE_REAL &_value, const T1 &arg1, const AD_TAPE_REAL &arg2 ) {
242  (void)_value;
243  (void)arg1;
244  (void)arg2;
245  return 1.0 / arg2;
246  }
247  };
248  template<class AD_TAPE_REAL>struct ad_div_pa {
249  template<class T2>static inline const AD_TAPE_REAL eval(const AD_TAPE_REAL &arg1, const T2 &arg2) {
250  return arg1 / arg2._value();
251  } template<class T2>static inline const AD_TAPE_REAL calc_partial2(const AD_TAPE_REAL &_value, const AD_TAPE_REAL &arg1, const T2 &arg2 ) {
252  (void) _value;
253  (void)arg1;
254  (void)arg2;
255  return -_value / arg2._value();
256  }
257  };
258  using std::sin;
259  template<class AD_TAPE_REAL>struct ad_sin {
260  template<class T>static inline const AD_TAPE_REAL eval(const T &arg) {
261  return sin(arg._value());
262  } template<class T>static inline const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x) {
263  (void)_value;
264  return (cos(x._value()));
265  }
266  };
267  using std::cos;
268  template<class AD_TAPE_REAL>struct ad_cos {
269  template<class T>static inline const AD_TAPE_REAL eval(const T &arg) {
270  return cos(arg._value());
271  } template<class T>static inline const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x) {
272  (void)_value;
273  return (-sin(x._value()));
274  }
275  };
276  using std::tan;
277  template<class AD_TAPE_REAL>struct ad_tan {
278  template<class T>static inline const AD_TAPE_REAL eval(const T &arg) {
279  return tan(arg._value());
280  } template<class T>static inline const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x) {
281  (void)_value;
282  return ((1.0 + (tan(x._value())*tan(x._value()))));
283  }
284  };
285  using std::cosh;
286  template<class AD_TAPE_REAL>struct ad_cosh {
287  template<class T>static inline const AD_TAPE_REAL eval(const T &arg) {
288  return cosh(arg._value());
289  } template<class T>static inline const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x) {
290  (void)_value;
291  return (sinh(x._value()));
292  }
293  };
294  using std::sinh;
295  template<class AD_TAPE_REAL>struct ad_sinh {
296  template<class T>static inline const AD_TAPE_REAL eval(const T &arg) {
297  return sinh(arg._value());
298  } template<class T>static inline const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x) {
299  (void)_value;
300  return (cosh(x._value()));
301  }
302  };
303  using std::asin;
304  template<class AD_TAPE_REAL>struct ad_asin {
305  template<class T>static inline const AD_TAPE_REAL eval(const T &arg) {
306  return asin(arg._value());
307  } template<class T>static inline const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x) {
308  (void)_value;
309  return (1 / sqrt(1.0 - x._value()*x._value()));
310  }
311  };
312  using std::acos;
313  template<class AD_TAPE_REAL>struct ad_acos {
314  template<class T>static inline const AD_TAPE_REAL eval(const T &arg) {
315  return acos(arg._value());
316  } template<class T>static inline const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x) {
317  (void)_value;
318  return (-1 / sqrt(1.0 - x._value()*x._value()));
319  }
320  };
321  using std::exp;
322  template<class AD_TAPE_REAL>struct ad_exp {
323  template<class T>static inline const AD_TAPE_REAL eval(const T &arg) {
324  return exp(arg._value());
325  } template<class T>static inline const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x) {
326  (void)_value;
327  return (exp(x._value()));
328  }
329  };
330  using std::atan;
331  template<class AD_TAPE_REAL>struct ad_atan {
332  template<class T>static inline const AD_TAPE_REAL eval(const T &arg) {
333  return atan(arg._value());
334  } template<class T>static inline const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x) {
335  (void)_value;
336  return (1.0 / (1.0 + x._value()*x._value()));
337  }
338  };
339  using std::tanh;
340  template<class AD_TAPE_REAL>struct ad_tanh {
341  template<class T>static inline const AD_TAPE_REAL eval(const T &arg) {
342  return tanh(arg._value());
343  } template<class T>static inline const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x) {
344  (void)_value;
345  return (1.0 - tanh(x._value())*tanh(x._value()));
346  }
347  };
348  using std::sqrt;
349  template<class AD_TAPE_REAL>struct ad_sqrt {
350  template<class T>static inline const AD_TAPE_REAL eval(const T &arg) {
351  return sqrt(arg._value());
352  } template<class T>static inline const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x) {
353  (void)_value;
354  return (1.0/(2.0*sqrt(x._value() + (x._value() > 0 ? 0.0 : 1e-8))));
355  }
356  };
357  using std::log;
358  template<class AD_TAPE_REAL>struct ad_log {
359  template<class T>static inline const AD_TAPE_REAL eval(const T &arg) {
360  return log(arg._value());
361  } template<class T>static inline const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x) {
362  (void)_value;
363  return (1.0 / x._value());
364  }
365  };
366  using ::erf;
367  template<class AD_TAPE_REAL>struct ad_erf {
368  template<class T>static inline const AD_TAPE_REAL eval(const T &arg) {
369  return erf(arg._value());
370  } template<class T>static inline const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x) {
371  (void)_value;
372  return (2.0 / sqrt(3.14159265358979323846264338327950288) * exp(-x._value() * x._value()));
373  }
374  };
375  using ::erfc;
376  template<class AD_TAPE_REAL>struct ad_erfc {
377  template<class T>static inline const AD_TAPE_REAL eval(const T &arg) {
378  return erfc(arg._value());
379  } template<class T>static inline const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x) {
380  (void)_value;
381  return (-2.0 / sqrt(3.14159265358979323846264338327950288) * exp(-x._value() * x._value()));
382  }
383  };
385  template<class AD_TAPE_REAL>struct ad_asinh {
386  template<class T>static inline const AD_TAPE_REAL eval(const T &arg) {
387  return asinh(arg._value());
388  } template<class T>static inline const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x) {
389  (void)_value;
390  return (1. / sqrt(1. + (x._value()*x._value())));
391  }
392  };
394  template<class AD_TAPE_REAL>struct ad_acosh {
395  template<class T>static inline const AD_TAPE_REAL eval(const T &arg) {
396  return acosh(arg._value());
397  } template<class T>static inline const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x) {
398  (void)_value;
399  return (1. / sqrt((x._value()*x._value()) - 1.));
400  }
401  };
403  template<class AD_TAPE_REAL>struct ad_expm1 {
404  template<class T>static inline const AD_TAPE_REAL eval(const T &arg) {
405  return expm1(arg._value());
406  } template<class T>static inline const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x) {
407  (void)_value;
408  return (exp(x._value()));
409  }
410  };
412  template<class AD_TAPE_REAL>struct ad_atanh {
413  template<class T>static inline const AD_TAPE_REAL eval(const T &arg) {
414  return atanh(arg._value());
415  } template<class T>static inline const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x) {
416  (void)_value;
417  return (1. / (1. - (x._value()*x._value())));
418  }
419  };
421  template<class AD_TAPE_REAL>struct ad_log1p {
422  template<class T>static inline const AD_TAPE_REAL eval(const T &arg) {
423  return log1p(arg._value());
424  } template<class T>static inline const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x) {
425  (void)_value;
426  return (1.0 / (x._value() + 1));
427  }
428  };
430  template<class AD_TAPE_REAL>struct ad_log10 {
431  template<class T>static inline const AD_TAPE_REAL eval(const T &arg) {
432  return log10(arg._value());
433  } template<class T>static inline const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x) {
434  (void)_value;
435  return (1.0 / (x._value()*log(10)));
436  }
437  };
438  template<class AD_TAPE_REAL>struct ad_minus {
439  template<class T>static inline const AD_TAPE_REAL eval(const T &arg1) {
440  return -arg1._value();
441  }
442  template<class T>static inline const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &arg1 ) {
443  (void)_value;
444  (void)arg1;
445  return -1.0;
446  }
447  };
448  template<class AD_TAPE_REAL>struct ad_plus {
449  template<class T>static inline const AD_TAPE_REAL eval(const T &arg1) {
450  return arg1._value();
451  }
452  template<class T>static inline const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &arg1 ) {
453  (void)_value;
454  (void)arg1;
455  return 1.0;
456  }
457  };
458  using ::fabs;
459  template<class AD_TAPE_REAL>struct ad_fabs {
460  template<class T>static inline const AD_TAPE_REAL eval(const T &arg1) {
461  return fabs(arg1._value());
462  }
463  template<class T>static inline const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &arg1 ) {
464  (void) _value;
465  if (arg1._value() < 0) return -1.0;
466  else return 1.0;
467  }
468  };
469  template<class AD_TAPE_REAL>struct ad_atan2_aa {
470  template<class T1, class T2>static inline const AD_TAPE_REAL eval(const T1 &arg1, const T2 &arg2) {
471  (void) arg1;
472  (void) arg2;
473  return atan2(arg1._value(),arg2._value());
474  } template<class T1,class T2>static inline const AD_TAPE_REAL calc_partial1(const AD_TAPE_REAL _value, const T1 &arg1, const T2 &arg2) {
475  (void) _value;
476  (void) arg1;
477  (void) arg2;
478  return arg2._value() / (arg2._value() * arg2._value() + arg1._value() * arg1._value());
479  } template<class T1,class T2>static inline const AD_TAPE_REAL calc_partial2(const AD_TAPE_REAL _value, const T1 &arg1, const T2 &arg2) {
480  (void) _value;
481  (void) arg1;
482  (void) arg2;
483  return -arg1._value() / (arg2._value() * arg2._value() + arg1._value() * arg1._value());
484  }
485  };
486  template<class AD_TAPE_REAL>struct ad_atan2_ap {
487  template<class T>static inline const AD_TAPE_REAL eval(const T &arg1, const AD_TAPE_REAL &arg2) {
488  (void) arg1;
489  (void) arg2;
490  return atan2(arg1._value(),arg2);
491  } template<class T>static inline const AD_TAPE_REAL calc_partial1(const AD_TAPE_REAL _value, const T &arg1, const AD_TAPE_REAL &arg2) {
492  (void) _value;
493  (void) arg1;
494  (void) arg2;
495  return arg2 / (arg2 * arg2 + arg1._value() * arg1._value());
496  }
497  };
498  template<class AD_TAPE_REAL>struct ad_atan2_pa {
499  template<class T>static inline const AD_TAPE_REAL eval(const AD_TAPE_REAL &arg1, const T &arg2) {
500  (void) arg1;
501  (void) arg2;
502  return atan2(arg1,arg2._value());
503  } template<class T>static inline const AD_TAPE_REAL calc_partial2(const AD_TAPE_REAL _value, const AD_TAPE_REAL &arg1, const T &arg2) {
504  (void) _value;
505  (void) arg1;
506  (void) arg2;
507  return -arg1 / (arg2._value() * arg2._value() + arg1 *arg1);
508  }
509  };
510  template<class AD_TAPE_REAL>
511  struct ad_pow_aa {
512  template<class T1, class T2>static inline const AD_TAPE_REAL eval(const T1 &arg1, const T2 &arg2) {
513  return pow(arg1._value(), arg2._value());
514  }
515  template<class T1, class T2>static inline const AD_TAPE_REAL calc_partial1(const AD_TAPE_REAL _value, const T1 &arg1, const T2 &arg2) {
516  (void)_value;
517  return arg2._value() * pow(arg1._value(), arg2._value() - 1.0);
518  }
519  template<class T1, class T2>static inline const AD_TAPE_REAL calc_partial2(const AD_TAPE_REAL _value, const T1 &arg1, const T2 &arg2) {
520  (void) _value;
521  if (arg1 <= 0)
522  return 0;
523  else
524  return log(arg1._value()) * pow(arg1._value(), arg2._value());
525  }
526  };
527  template<class AD_TAPE_REAL>
528  struct ad_pow_ap {
529  template<class T>static inline const AD_TAPE_REAL eval(const T &arg1, const AD_TAPE_REAL &arg2) {
530  return pow(arg1._value(), arg2);
531  }
532  template<class T>static inline const AD_TAPE_REAL calc_partial1(const AD_TAPE_REAL _value, const T &arg1, const AD_TAPE_REAL &arg2) {
533  (void) _value;
534  return arg2 * pow(arg1._value(), arg2 - 1.0);
535  }
536  };
537  template<class AD_TAPE_REAL>
538  struct ad_pow_pa {
539  template<class T>static inline const AD_TAPE_REAL eval(const AD_TAPE_REAL &arg1, const T &arg2) {
540  return pow(arg1, arg2._value());
541  }
542  template<class T>static inline const AD_TAPE_REAL calc_partial2(const AD_TAPE_REAL _value, const AD_TAPE_REAL &arg1, const T &arg2) {
543  (void) _value;
544  return log(arg1) * pow(arg1, arg2._value());
545  }
546  };
547  template<class AD_TAPE_REAL>struct ad_hypot_aa {
548  template<class T1, class T2>static inline const AD_TAPE_REAL eval(const T1 &arg1, const T2 &arg2) {
549  (void) arg1;
550  (void) arg2;
551  return hypot(arg1._value(),arg2._value());
552  } template<class T1,class T2>static inline const AD_TAPE_REAL calc_partial1(const AD_TAPE_REAL _value, const T1 &arg1, const T2 &arg2) {
553  (void) _value;
554  (void) arg1;
555  (void) arg2;
556  return arg1._value() / _value;
557  } template<class T1,class T2>static inline const AD_TAPE_REAL calc_partial2(const AD_TAPE_REAL _value, const T1 &arg1, const T2 &arg2) {
558  (void) _value;
559  (void) arg1;
560  (void) arg2;
561  return arg2._value() / _value;
562  }
563  };
564  template<class AD_TAPE_REAL>struct ad_hypot_ap {
565  template<class T>static inline const AD_TAPE_REAL eval(const T &arg1, const AD_TAPE_REAL &arg2) {
566  (void) arg1;
567  (void) arg2;
568  return hypot(arg1._value(),arg2);
569  } template<class T>static inline const AD_TAPE_REAL calc_partial1(const AD_TAPE_REAL _value, const T &arg1, const AD_TAPE_REAL &arg2) {
570  (void) _value;
571  (void) arg1;
572  (void) arg2;
573  return arg1._value() / _value;
574  }
575  };
576  template<class AD_TAPE_REAL>struct ad_hypot_pa {
577  template<class T>static inline const AD_TAPE_REAL eval(const AD_TAPE_REAL &arg1, const T &arg2) {
578  (void) arg1;
579  (void) arg2;
580  return hypot(arg1,arg2._value());
581  } template<class T>static inline const AD_TAPE_REAL calc_partial2(const AD_TAPE_REAL _value, const AD_TAPE_REAL &arg1, const T &arg2) {
582  (void) _value;
583  (void) arg1;
584  (void) arg2;
585  return arg2._value() / _value;
586  }
587  };
588  }
589 }
590 namespace ad {
591  namespace helper {
592  template <typename T>
593  struct type_identity {
594  typedef T type;
595  };
596  }
597 }
598 namespace ad {
599  template<typename TYPE>
601  const TYPE &T;
602  public:
603  reference_constructor_wrapper(const TYPE &T_) : T(T_) {}
604  template <typename TO_CREATE>
605  TO_CREATE *create() const {
606  return new TO_CREATE(T);
607  }
608  };
609  template<>
611  public:
613  (void) v;
614  }
615  template <typename TO_CREATE>
616  TO_CREATE *create() const {
617  return new TO_CREATE();
618  }
619  };
620 }
621 namespace ad {
622  namespace internal {
623  template<class AD_TAPE_REAL, class AD_ARG, class AD_OPERATION> struct unary_intermediate {
624  const AD_TAPE_REAL _value_;
625  const AD_ARG &_arg;
626  typedef AD_TAPE_REAL VALUE_TYPE;
627  typedef typename AD_ARG::DATA_TYPE DATA_TYPE;
628  explicit unary_intermediate(const AD_ARG &arg) : _value_(AD_OPERATION::eval(arg)), _arg(arg) {
629  }
630  inline const AD_TAPE_REAL &_value() const {
631  return _value_;
632  }
633  inline const AD_TAPE_REAL pval() const {
634  return AD_OPERATION::calc_partial(_value(), _arg);
635  }
636  };
637  template<class AD_TAPE_REAL, class AD_ARG1, class AD_ARG2, class AD_OPERATION> struct binary_intermediate_aa {
638  AD_TAPE_REAL _value_;
639  const AD_ARG1 &_arg1;
640  const AD_ARG2 &_arg2;
641  typedef AD_TAPE_REAL VALUE_TYPE;
642  typedef typename AD_ARG1::DATA_TYPE DATA_TYPE;
643  binary_intermediate_aa(const AD_ARG1 &arg1, const AD_ARG2 &arg2) :
644  _value_(AD_OPERATION::eval(arg1, arg2)),
645  _arg1(arg1),
646  _arg2(arg2) {
647  }
648  inline const AD_TAPE_REAL pval1() const {
649  return AD_OPERATION::calc_partial1(_value(), _arg1, _arg2);
650  }
651  inline const AD_TAPE_REAL pval2() const {
652  return AD_OPERATION::calc_partial2(_value(), _arg1, _arg2);
653  }
654  inline const AD_TAPE_REAL &_value() const {
655  return _value_;
656  }
657  };
658  template<class AD_TAPE_REAL, class AD_ARG1, class AD_OPERATION> struct binary_intermediate_ap {
659  const AD_TAPE_REAL _value_;
660  const AD_ARG1 &_arg1;
661  const AD_TAPE_REAL _arg2;
662  typedef AD_TAPE_REAL VALUE_TYPE;
663  typedef typename AD_ARG1::DATA_TYPE DATA_TYPE;
664  binary_intermediate_ap(const AD_ARG1 &arg1, const AD_TAPE_REAL &arg2) :
665  _value_(AD_OPERATION::eval(arg1, arg2)), _arg1(arg1), _arg2(arg2) {}
666  inline const AD_TAPE_REAL &_value() const {
667  return _value_;
668  }
669  inline const AD_TAPE_REAL pval1() const {
670  return AD_OPERATION::calc_partial1(_value_, _arg1, _arg2);
671  }
672  };
673  template<class AD_TAPE_REAL, class AD_ARG2, class AD_OPERATION> struct binary_intermediate_pa {
674  const AD_TAPE_REAL _value_;
675  const AD_TAPE_REAL _arg1;
676  const AD_ARG2 &_arg2;
677  typedef AD_TAPE_REAL VALUE_TYPE;
678  typedef typename AD_ARG2::DATA_TYPE DATA_TYPE;
679  binary_intermediate_pa(const AD_TAPE_REAL &arg1, const AD_ARG2 &arg2) :
680  _value_(AD_OPERATION::eval(arg1, arg2)), _arg1(arg1), _arg2(arg2) {}
681  inline const AD_TAPE_REAL &_value() const {
682  return _value_;
683  }
684  inline const AD_TAPE_REAL pval2() const {
685  return AD_OPERATION::calc_partial2(_value_, _arg1, _arg2);
686  }
687  };
688  template <typename T>
690  typedef T TYPE;
691  };
692  template<class AD_TAPE_REAL, class DATA_HANDLER> struct active_type {
693  private:
694  AD_TAPE_REAL _value_;
695  DATA_HANDLER _data_;
696  public:
697  typedef AD_TAPE_REAL VALUE_TYPE;
698  typedef DATA_HANDLER DATA_TYPE;
700  inline const AD_TAPE_REAL &_value() const {
701  return _value_;
702  }
703  inline AD_TAPE_REAL &_value() {
704  return _value_;
705  }
706  inline const DATA_HANDLER &_data() const {
707  return _data_;
708  }
709  inline DATA_HANDLER &_data() {
710  return _data_;
711  }
712  inline void _clear() {
713  _data_.clear();
714  }
715 
716  inline active_type(const active_type&) = default;
717  template<typename TYPE, typename TEST = typename ad_type_constructable_from<TYPE,active_type>::type>
718  inline active_type& operator=(const TYPE &val) {
719  _value_ = val;
720  _data_.clear();
721  return *this;
722  }
723  template<typename TYPE, typename TEST = typename ad_type_constructable_from<TYPE,active_type>::type>
724  inline active_type(const TYPE &val) :
725  _value_(val) {}
726 
727  inline active_type() : _value_(static_cast<AD_TAPE_REAL>(0.0)) {}
728  template<class AD_TAPE_REAL_TMP, class DATA_HANDLER_TMP>
730  inline active_type(const PASSIVE_VALUE_TYPE &val) : _value_(val) {}
731  inline active_type &operator = (const active_type &x) {
732  this->_value_ = x._value_;
733  this->_data_ = x._data_;
734  return *this;
735  }
737  this->_value_ = vneu;
738  this->_data_.clear();
739  return *this;
740  }
741  template<class AD_TAPE_REAL_TMP, class DATA_HANDLER_TMP>
743  this->_value_ = vneu;
744  this->_data_.clear();
745  return *this;
746  }
747  private:
748  template<class A1_T1, class A1_T2, class A1_OP > inline void build_from(const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP> &x) {
749  DATA_HANDLER::handle(x, *this);
750  this->_value_ = x._value_;
751  } public:
752  template<class A1_T1, class A1_T2, class A1_OP > active_type(const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP> &x) {
753  build_from(x);
754  } template<class A1_T1, class A1_T2, class A1_OP > inline active_type& operator=(const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP> &x) {
755  build_from(x);
756  return *this;
757  }
758  private:
759  template<class A1_T1, class A1_OP > inline void build_from(const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP> &x) {
760  DATA_HANDLER::handle(x, *this);
761  this->_value_ = x._value_;
762  } public:
764  build_from(x);
765  } template<class A1_T1, class A1_OP > inline active_type& operator=(const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP> &x) {
766  build_from(x);
767  return *this;
768  }
769  private:
770  template<class A1_T2, class A1_OP > inline void build_from(const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP> &x) {
771  DATA_HANDLER::handle(x, *this);
772  this->_value_ = x._value_;
773  } public:
775  build_from(x);
776  } template<class A1_T2, class A1_OP > inline active_type& operator=(const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP> &x) {
777  build_from(x);
778  return *this;
779  }
780  private:
781  template<class A1_T, class A1_OP > inline void build_from(const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP> &x) {
782  DATA_HANDLER::handle(x, *this);
783  this->_value_ = x._value_;
784  } public:
785  template<class A1_T, class A1_OP > active_type(const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP> &x) {
786  build_from(x);
787  } template<class A1_T, class A1_OP > inline active_type& operator=(const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP> &x) {
788  build_from(x);
789  return *this;
790  }
791  template<class DATA_HANDLER_TMP> inline active_type& operator += (const active_type<AD_TAPE_REAL, DATA_HANDLER_TMP> &x) {
792  *this = *this + x;
793  return *this;
794  } template<class A1_T1, class A1_T2, class A1_OP > inline active_type& operator += (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP> &x) {
795  *this = *this + x;
796  return *this;
797  } template<class A1_T1, class A1_OP > inline active_type& operator += (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP> &x) {
798  *this = *this + x;
799  return *this;
800  } template<class A1_T2, class A1_OP > inline active_type& operator += (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP> &x) {
801  *this = *this + x;
802  return *this;
803  } template<class A1_T, class A1_OP > inline active_type& operator += (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP> &x) {
804  *this = *this + x;
805  return *this;
806  } inline active_type& operator += (const AD_TAPE_REAL &x) {
807  this->_value() += x;
808  return *this;
809  }
810  template<class DATA_HANDLER_TMP> inline active_type& operator -= (const active_type<AD_TAPE_REAL, DATA_HANDLER_TMP> &x) {
811  *this = *this - x;
812  return *this;
813  } template<class A1_T1, class A1_T2, class A1_OP > inline active_type& operator -= (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP> &x) {
814  *this = *this - x;
815  return *this;
816  } template<class A1_T1, class A1_OP > inline active_type& operator -= (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP> &x) {
817  *this = *this - x;
818  return *this;
819  } template<class A1_T2, class A1_OP > inline active_type& operator -= (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP> &x) {
820  *this = *this - x;
821  return *this;
822  } template<class A1_T, class A1_OP > inline active_type& operator -= (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP> &x) {
823  *this = *this - x;
824  return *this;
825  } inline active_type& operator -= (const AD_TAPE_REAL &x) {
826  this->_value() -= x;
827  return *this;
828  }
829  template<class DATA_HANDLER_TMP> inline active_type& operator *= (const active_type<AD_TAPE_REAL, DATA_HANDLER_TMP> &x) {
830  *this = *this * x;
831  return *this;
832  } template<class A1_T1, class A1_T2, class A1_OP > inline active_type& operator *= (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP> &x) {
833  *this = *this * x;
834  return *this;
835  } template<class A1_T1, class A1_OP > inline active_type& operator *= (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP> &x) {
836  *this = *this * x;
837  return *this;
838  } template<class A1_T2, class A1_OP > inline active_type& operator *= (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP> &x) {
839  *this = *this * x;
840  return *this;
841  } template<class A1_T, class A1_OP > inline active_type& operator *= (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP> &x) {
842  *this = *this * x;
843  return *this;
844  } inline active_type& operator *= (const AD_TAPE_REAL &x) {
845  *this = *this * x;
846  return *this;
847  }
848  template<class DATA_HANDLER_TMP> inline active_type& operator /= (const active_type<AD_TAPE_REAL, DATA_HANDLER_TMP> &x) {
849  *this = *this / x;
850  return *this;
851  } template<class A1_T1, class A1_T2, class A1_OP > inline active_type& operator /= (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP> &x) {
852  *this = *this / x;
853  return *this;
854  } template<class A1_T1, class A1_OP > inline active_type& operator /= (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP> &x) {
855  *this = *this / x;
856  return *this;
857  } template<class A1_T2, class A1_OP > inline active_type& operator /= (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP> &x) {
858  *this = *this / x;
859  return *this;
860  } template<class A1_T, class A1_OP > inline active_type& operator /= (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP> &x) {
861  *this = *this / x;
862  return *this;
863  } inline active_type& operator /= (const AD_TAPE_REAL &x) {
864  *this = *this / x;
865  return *this;
866  }
868  ++this->_value_;
869  return *this;
870  }
872  --this->_value_;
873  return *this;
874  }
875  inline active_type operator ++(int) {
876  active_type ret(*this);
877  ++this->_value_;
878  return ret;
879  }
880  inline active_type operator --(int) {
881  active_type ret(*this);
882  --this->_value_;
883  return ret;
884  }
885  };
886  template<class AD_TAPE_REAL, class DATA_HANDLER>
887  struct passive_value_type_of<active_type<AD_TAPE_REAL, DATA_HANDLER> > {
889  };
890 
901  }
912  }
923  }
934  }
945  }
956  }
967  }
978  }
989  }
1000  }
1011  }
1022  }
1033  }
1044  }
1055  }
1066  }
1077  }
1088  }
1099  }
1110  }
1121  }
1132  }
1143  }
1154  }
1245  }
1336  }
1427  }
1518  }
1609  }
1700  }
1791  }
1792  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool operator == (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x2) ;
1793  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool operator == (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x2) {
1794  return x1._value() == x2._value();
1795  } template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T, class A2_OP > static inline bool operator == (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) ;
1796  template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T, class A2_OP > static inline bool operator == (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) {
1797  return x1._value() == x2._value();
1798  } template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T1, class A2_T2, class A2_OP > static inline bool operator == (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) ;
1799  template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T1, class A2_T2, class A2_OP > static inline bool operator == (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) {
1800  return x1._value() == x2._value();
1801  } template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T1, class A2_OP > static inline bool operator == (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) ;
1802  template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T1, class A2_OP > static inline bool operator == (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) {
1803  return x1._value() == x2._value();
1804  } template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T2, class A2_OP > static inline bool operator == (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) ;
1805  template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T2, class A2_OP > static inline bool operator == (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) {
1806  return x1._value() == x2._value();
1807  } template<class AD_TAPE_REAL, class A1_T, class A1_OP, class DATA_HANDLER_2 > static inline bool operator == (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) ;
1808  template<class AD_TAPE_REAL, class A1_T, class A1_OP, class DATA_HANDLER_2 > static inline bool operator == (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) {
1809  return x1._value() == x2._value();
1810  } template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T, class A2_OP > static inline bool operator == (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) ;
1811  template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T, class A2_OP > static inline bool operator == (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) {
1812  return x1._value() == x2._value();
1813  } template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator == (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) ;
1814  template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator == (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) {
1815  return x1._value() == x2._value();
1816  } template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T1, class A2_OP > static inline bool operator == (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) ;
1817  template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T1, class A2_OP > static inline bool operator == (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) {
1818  return x1._value() == x2._value();
1819  } template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T2, class A2_OP > static inline bool operator == (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) ;
1820  template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T2, class A2_OP > static inline bool operator == (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) {
1821  return x1._value() == x2._value();
1822  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class DATA_HANDLER_2 > static inline bool operator == (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) ;
1823  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class DATA_HANDLER_2 > static inline bool operator == (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) {
1824  return x1._value() == x2._value();
1825  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T, class A2_OP > static inline bool operator == (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) ;
1826  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T, class A2_OP > static inline bool operator == (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) {
1827  return x1._value() == x2._value();
1828  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator == (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) ;
1829  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator == (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) {
1830  return x1._value() == x2._value();
1831  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T1, class A2_OP > static inline bool operator == (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) ;
1832  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T1, class A2_OP > static inline bool operator == (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) {
1833  return x1._value() == x2._value();
1834  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T2, class A2_OP > static inline bool operator == (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) ;
1835  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T2, class A2_OP > static inline bool operator == (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) {
1836  return x1._value() == x2._value();
1837  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class DATA_HANDLER_2 > static inline bool operator == (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) ;
1838  template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class DATA_HANDLER_2 > static inline bool operator == (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) {
1839  return x1._value() == x2._value();
1840  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T, class A2_OP > static inline bool operator == (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) ;
1841  template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T, class A2_OP > static inline bool operator == (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) {
1842  return x1._value() == x2._value();
1843  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator == (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) ;
1844  template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator == (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) {
1845  return x1._value() == x2._value();
1846  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T1, class A2_OP > static inline bool operator == (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) ;
1847  template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T1, class A2_OP > static inline bool operator == (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) {
1848  return x1._value() == x2._value();
1849  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T2, class A2_OP > static inline bool operator == (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) ;
1850  template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T2, class A2_OP > static inline bool operator == (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) {
1851  return x1._value() == x2._value();
1852  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class DATA_HANDLER_2 > static inline bool operator == (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) ;
1853  template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class DATA_HANDLER_2 > static inline bool operator == (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) {
1854  return x1._value() == x2._value();
1855  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T, class A2_OP > static inline bool operator == (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) ;
1856  template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T, class A2_OP > static inline bool operator == (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) {
1857  return x1._value() == x2._value();
1858  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator == (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) ;
1859  template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator == (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) {
1860  return x1._value() == x2._value();
1861  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T1, class A2_OP > static inline bool operator == (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) ;
1862  template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T1, class A2_OP > static inline bool operator == (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) {
1863  return x1._value() == x2._value();
1864  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T2, class A2_OP > static inline bool operator == (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) ;
1865  template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T2, class A2_OP > static inline bool operator == (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) {
1866  return x1._value() == x2._value();
1867  } template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool operator == (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const double& x2);
1868  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool operator == (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const double& x2) {
1869  return x1._value() == x2;
1870  } template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool operator == (const double& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x2);
1871  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool operator == (const double& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x2) {
1872  return x1 == x2._value();
1873  } template<class AD_TAPE_REAL, class A1_T, class A1_OP > static inline bool operator == (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const double& x2);
1874  template<class AD_TAPE_REAL, class A1_T, class A1_OP > static inline bool operator == (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const double& x2) {
1875  return x1._value() == x2;
1876  } template<class AD_TAPE_REAL, class A1_T, class A1_OP > static inline bool operator == (const double& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x2);
1877  template<class AD_TAPE_REAL, class A1_T, class A1_OP > static inline bool operator == (const double& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x2) {
1878  return x1 == x2._value();
1879  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > static inline bool operator == (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const double& x2);
1880  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > static inline bool operator == (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const double& x2) {
1881  return x1._value() == x2;
1882  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > static inline bool operator == (const double& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x2);
1883  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > static inline bool operator == (const double& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x2) {
1884  return x1 == x2._value();
1885  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP > static inline bool operator == (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const double& x2);
1886  template<class AD_TAPE_REAL, class A1_T1, class A1_OP > static inline bool operator == (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const double& x2) {
1887  return x1._value() == x2;
1888  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP > static inline bool operator == (const double& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x2);
1889  template<class AD_TAPE_REAL, class A1_T1, class A1_OP > static inline bool operator == (const double& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x2) {
1890  return x1 == x2._value();
1891  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP > static inline bool operator == (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const double& x2);
1892  template<class AD_TAPE_REAL, class A1_T2, class A1_OP > static inline bool operator == (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const double& x2) {
1893  return x1._value() == x2;
1894  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP > static inline bool operator == (const double& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x2);
1895  template<class AD_TAPE_REAL, class A1_T2, class A1_OP > static inline bool operator == (const double& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x2) {
1896  return x1 == x2._value();
1897  }
1898  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool operator != (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x2) ;
1899  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool operator != (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x2) {
1900  return x1._value() != x2._value();
1901  } template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T, class A2_OP > static inline bool operator != (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) ;
1902  template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T, class A2_OP > static inline bool operator != (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) {
1903  return x1._value() != x2._value();
1904  } template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T1, class A2_T2, class A2_OP > static inline bool operator != (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) ;
1905  template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T1, class A2_T2, class A2_OP > static inline bool operator != (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) {
1906  return x1._value() != x2._value();
1907  } template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T1, class A2_OP > static inline bool operator != (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) ;
1908  template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T1, class A2_OP > static inline bool operator != (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) {
1909  return x1._value() != x2._value();
1910  } template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T2, class A2_OP > static inline bool operator != (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) ;
1911  template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T2, class A2_OP > static inline bool operator != (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) {
1912  return x1._value() != x2._value();
1913  } template<class AD_TAPE_REAL, class A1_T, class A1_OP, class DATA_HANDLER_2 > static inline bool operator != (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) ;
1914  template<class AD_TAPE_REAL, class A1_T, class A1_OP, class DATA_HANDLER_2 > static inline bool operator != (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) {
1915  return x1._value() != x2._value();
1916  } template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T, class A2_OP > static inline bool operator != (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) ;
1917  template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T, class A2_OP > static inline bool operator != (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) {
1918  return x1._value() != x2._value();
1919  } template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator != (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) ;
1920  template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator != (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) {
1921  return x1._value() != x2._value();
1922  } template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T1, class A2_OP > static inline bool operator != (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) ;
1923  template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T1, class A2_OP > static inline bool operator != (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) {
1924  return x1._value() != x2._value();
1925  } template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T2, class A2_OP > static inline bool operator != (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) ;
1926  template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T2, class A2_OP > static inline bool operator != (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) {
1927  return x1._value() != x2._value();
1928  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class DATA_HANDLER_2 > static inline bool operator != (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) ;
1929  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class DATA_HANDLER_2 > static inline bool operator != (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) {
1930  return x1._value() != x2._value();
1931  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T, class A2_OP > static inline bool operator != (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) ;
1932  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T, class A2_OP > static inline bool operator != (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) {
1933  return x1._value() != x2._value();
1934  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator != (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) ;
1935  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator != (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) {
1936  return x1._value() != x2._value();
1937  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T1, class A2_OP > static inline bool operator != (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) ;
1938  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T1, class A2_OP > static inline bool operator != (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) {
1939  return x1._value() != x2._value();
1940  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T2, class A2_OP > static inline bool operator != (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) ;
1941  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T2, class A2_OP > static inline bool operator != (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) {
1942  return x1._value() != x2._value();
1943  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class DATA_HANDLER_2 > static inline bool operator != (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) ;
1944  template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class DATA_HANDLER_2 > static inline bool operator != (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) {
1945  return x1._value() != x2._value();
1946  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T, class A2_OP > static inline bool operator != (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) ;
1947  template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T, class A2_OP > static inline bool operator != (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) {
1948  return x1._value() != x2._value();
1949  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator != (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) ;
1950  template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator != (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) {
1951  return x1._value() != x2._value();
1952  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T1, class A2_OP > static inline bool operator != (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) ;
1953  template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T1, class A2_OP > static inline bool operator != (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) {
1954  return x1._value() != x2._value();
1955  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T2, class A2_OP > static inline bool operator != (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) ;
1956  template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T2, class A2_OP > static inline bool operator != (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) {
1957  return x1._value() != x2._value();
1958  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class DATA_HANDLER_2 > static inline bool operator != (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) ;
1959  template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class DATA_HANDLER_2 > static inline bool operator != (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) {
1960  return x1._value() != x2._value();
1961  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T, class A2_OP > static inline bool operator != (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) ;
1962  template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T, class A2_OP > static inline bool operator != (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) {
1963  return x1._value() != x2._value();
1964  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator != (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) ;
1965  template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator != (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) {
1966  return x1._value() != x2._value();
1967  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T1, class A2_OP > static inline bool operator != (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) ;
1968  template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T1, class A2_OP > static inline bool operator != (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) {
1969  return x1._value() != x2._value();
1970  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T2, class A2_OP > static inline bool operator != (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) ;
1971  template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T2, class A2_OP > static inline bool operator != (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) {
1972  return x1._value() != x2._value();
1973  } template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool operator != (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const double& x2);
1974  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool operator != (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const double& x2) {
1975  return x1._value() != x2;
1976  } template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool operator != (const double& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x2);
1977  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool operator != (const double& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x2) {
1978  return x1 != x2._value();
1979  } template<class AD_TAPE_REAL, class A1_T, class A1_OP > static inline bool operator != (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const double& x2);
1980  template<class AD_TAPE_REAL, class A1_T, class A1_OP > static inline bool operator != (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const double& x2) {
1981  return x1._value() != x2;
1982  } template<class AD_TAPE_REAL, class A1_T, class A1_OP > static inline bool operator != (const double& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x2);
1983  template<class AD_TAPE_REAL, class A1_T, class A1_OP > static inline bool operator != (const double& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x2) {
1984  return x1 != x2._value();
1985  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > static inline bool operator != (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const double& x2);
1986  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > static inline bool operator != (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const double& x2) {
1987  return x1._value() != x2;
1988  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > static inline bool operator != (const double& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x2);
1989  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > static inline bool operator != (const double& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x2) {
1990  return x1 != x2._value();
1991  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP > static inline bool operator != (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const double& x2);
1992  template<class AD_TAPE_REAL, class A1_T1, class A1_OP > static inline bool operator != (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const double& x2) {
1993  return x1._value() != x2;
1994  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP > static inline bool operator != (const double& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x2);
1995  template<class AD_TAPE_REAL, class A1_T1, class A1_OP > static inline bool operator != (const double& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x2) {
1996  return x1 != x2._value();
1997  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP > static inline bool operator != (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const double& x2);
1998  template<class AD_TAPE_REAL, class A1_T2, class A1_OP > static inline bool operator != (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const double& x2) {
1999  return x1._value() != x2;
2000  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP > static inline bool operator != (const double& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x2);
2001  template<class AD_TAPE_REAL, class A1_T2, class A1_OP > static inline bool operator != (const double& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x2) {
2002  return x1 != x2._value();
2003  }
2004  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool operator < (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x2) ;
2005  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool operator < (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x2) {
2006  return x1._value() < x2._value();
2007  } template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T, class A2_OP > static inline bool operator < (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) ;
2008  template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T, class A2_OP > static inline bool operator < (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) {
2009  return x1._value() < x2._value();
2010  } template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T1, class A2_T2, class A2_OP > static inline bool operator < (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) ;
2011  template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T1, class A2_T2, class A2_OP > static inline bool operator < (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) {
2012  return x1._value() < x2._value();
2013  } template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T1, class A2_OP > static inline bool operator < (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) ;
2014  template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T1, class A2_OP > static inline bool operator < (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) {
2015  return x1._value() < x2._value();
2016  } template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T2, class A2_OP > static inline bool operator < (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) ;
2017  template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T2, class A2_OP > static inline bool operator < (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) {
2018  return x1._value() < x2._value();
2019  } template<class AD_TAPE_REAL, class A1_T, class A1_OP, class DATA_HANDLER_2 > static inline bool operator < (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) ;
2020  template<class AD_TAPE_REAL, class A1_T, class A1_OP, class DATA_HANDLER_2 > static inline bool operator < (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) {
2021  return x1._value() < x2._value();
2022  } template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T, class A2_OP > static inline bool operator < (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) ;
2023  template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T, class A2_OP > static inline bool operator < (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) {
2024  return x1._value() < x2._value();
2025  } template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator < (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) ;
2026  template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator < (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) {
2027  return x1._value() < x2._value();
2028  } template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T1, class A2_OP > static inline bool operator < (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) ;
2029  template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T1, class A2_OP > static inline bool operator < (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) {
2030  return x1._value() < x2._value();
2031  } template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T2, class A2_OP > static inline bool operator < (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) ;
2032  template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T2, class A2_OP > static inline bool operator < (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) {
2033  return x1._value() < x2._value();
2034  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class DATA_HANDLER_2 > static inline bool operator < (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) ;
2035  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class DATA_HANDLER_2 > static inline bool operator < (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) {
2036  return x1._value() < x2._value();
2037  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T, class A2_OP > static inline bool operator < (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) ;
2038  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T, class A2_OP > static inline bool operator < (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) {
2039  return x1._value() < x2._value();
2040  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator < (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) ;
2041  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator < (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) {
2042  return x1._value() < x2._value();
2043  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T1, class A2_OP > static inline bool operator < (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) ;
2044  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T1, class A2_OP > static inline bool operator < (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) {
2045  return x1._value() < x2._value();
2046  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T2, class A2_OP > static inline bool operator < (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) ;
2047  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T2, class A2_OP > static inline bool operator < (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) {
2048  return x1._value() < x2._value();
2049  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class DATA_HANDLER_2 > static inline bool operator < (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) ;
2050  template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class DATA_HANDLER_2 > static inline bool operator < (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) {
2051  return x1._value() < x2._value();
2052  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T, class A2_OP > static inline bool operator < (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) ;
2053  template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T, class A2_OP > static inline bool operator < (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) {
2054  return x1._value() < x2._value();
2055  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator < (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) ;
2056  template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator < (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) {
2057  return x1._value() < x2._value();
2058  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T1, class A2_OP > static inline bool operator < (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) ;
2059  template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T1, class A2_OP > static inline bool operator < (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) {
2060  return x1._value() < x2._value();
2061  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T2, class A2_OP > static inline bool operator < (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) ;
2062  template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T2, class A2_OP > static inline bool operator < (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) {
2063  return x1._value() < x2._value();
2064  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class DATA_HANDLER_2 > static inline bool operator < (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) ;
2065  template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class DATA_HANDLER_2 > static inline bool operator < (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) {
2066  return x1._value() < x2._value();
2067  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T, class A2_OP > static inline bool operator < (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) ;
2068  template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T, class A2_OP > static inline bool operator < (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) {
2069  return x1._value() < x2._value();
2070  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator < (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) ;
2071  template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator < (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) {
2072  return x1._value() < x2._value();
2073  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T1, class A2_OP > static inline bool operator < (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) ;
2074  template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T1, class A2_OP > static inline bool operator < (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) {
2075  return x1._value() < x2._value();
2076  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T2, class A2_OP > static inline bool operator < (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) ;
2077  template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T2, class A2_OP > static inline bool operator < (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) {
2078  return x1._value() < x2._value();
2079  } template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool operator < (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const double& x2);
2080  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool operator < (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const double& x2) {
2081  return x1._value() < x2;
2082  } template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool operator < (const double& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x2);
2083  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool operator < (const double& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x2) {
2084  return x1 < x2._value();
2085  } template<class AD_TAPE_REAL, class A1_T, class A1_OP > static inline bool operator < (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const double& x2);
2086  template<class AD_TAPE_REAL, class A1_T, class A1_OP > static inline bool operator < (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const double& x2) {
2087  return x1._value() < x2;
2088  } template<class AD_TAPE_REAL, class A1_T, class A1_OP > static inline bool operator < (const double& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x2);
2089  template<class AD_TAPE_REAL, class A1_T, class A1_OP > static inline bool operator < (const double& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x2) {
2090  return x1 < x2._value();
2091  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > static inline bool operator < (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const double& x2);
2092  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > static inline bool operator < (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const double& x2) {
2093  return x1._value() < x2;
2094  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > static inline bool operator < (const double& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x2);
2095  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > static inline bool operator < (const double& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x2) {
2096  return x1 < x2._value();
2097  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP > static inline bool operator < (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const double& x2);
2098  template<class AD_TAPE_REAL, class A1_T1, class A1_OP > static inline bool operator < (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const double& x2) {
2099  return x1._value() < x2;
2100  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP > static inline bool operator < (const double& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x2);
2101  template<class AD_TAPE_REAL, class A1_T1, class A1_OP > static inline bool operator < (const double& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x2) {
2102  return x1 < x2._value();
2103  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP > static inline bool operator < (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const double& x2);
2104  template<class AD_TAPE_REAL, class A1_T2, class A1_OP > static inline bool operator < (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const double& x2) {
2105  return x1._value() < x2;
2106  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP > static inline bool operator < (const double& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x2);
2107  template<class AD_TAPE_REAL, class A1_T2, class A1_OP > static inline bool operator < (const double& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x2) {
2108  return x1 < x2._value();
2109  }
2110  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool operator <= (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x2) ;
2111  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool operator <= (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x2) {
2112  return x1._value() <= x2._value();
2113  } template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T, class A2_OP > static inline bool operator <= (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) ;
2114  template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T, class A2_OP > static inline bool operator <= (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) {
2115  return x1._value() <= x2._value();
2116  } template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T1, class A2_T2, class A2_OP > static inline bool operator <= (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) ;
2117  template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T1, class A2_T2, class A2_OP > static inline bool operator <= (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) {
2118  return x1._value() <= x2._value();
2119  } template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T1, class A2_OP > static inline bool operator <= (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) ;
2120  template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T1, class A2_OP > static inline bool operator <= (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) {
2121  return x1._value() <= x2._value();
2122  } template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T2, class A2_OP > static inline bool operator <= (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) ;
2123  template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T2, class A2_OP > static inline bool operator <= (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) {
2124  return x1._value() <= x2._value();
2125  } template<class AD_TAPE_REAL, class A1_T, class A1_OP, class DATA_HANDLER_2 > static inline bool operator <= (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) ;
2126  template<class AD_TAPE_REAL, class A1_T, class A1_OP, class DATA_HANDLER_2 > static inline bool operator <= (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) {
2127  return x1._value() <= x2._value();
2128  } template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T, class A2_OP > static inline bool operator <= (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) ;
2129  template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T, class A2_OP > static inline bool operator <= (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) {
2130  return x1._value() <= x2._value();
2131  } template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator <= (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) ;
2132  template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator <= (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) {
2133  return x1._value() <= x2._value();
2134  } template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T1, class A2_OP > static inline bool operator <= (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) ;
2135  template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T1, class A2_OP > static inline bool operator <= (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) {
2136  return x1._value() <= x2._value();
2137  } template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T2, class A2_OP > static inline bool operator <= (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) ;
2138  template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T2, class A2_OP > static inline bool operator <= (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) {
2139  return x1._value() <= x2._value();
2140  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class DATA_HANDLER_2 > static inline bool operator <= (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) ;
2141  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class DATA_HANDLER_2 > static inline bool operator <= (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) {
2142  return x1._value() <= x2._value();
2143  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T, class A2_OP > static inline bool operator <= (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) ;
2144  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T, class A2_OP > static inline bool operator <= (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) {
2145  return x1._value() <= x2._value();
2146  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator <= (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) ;
2147  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator <= (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) {
2148  return x1._value() <= x2._value();
2149  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T1, class A2_OP > static inline bool operator <= (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) ;
2150  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T1, class A2_OP > static inline bool operator <= (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) {
2151  return x1._value() <= x2._value();
2152  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T2, class A2_OP > static inline bool operator <= (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) ;
2153  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T2, class A2_OP > static inline bool operator <= (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) {
2154  return x1._value() <= x2._value();
2155  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class DATA_HANDLER_2 > static inline bool operator <= (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) ;
2156  template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class DATA_HANDLER_2 > static inline bool operator <= (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) {
2157  return x1._value() <= x2._value();
2158  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T, class A2_OP > static inline bool operator <= (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) ;
2159  template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T, class A2_OP > static inline bool operator <= (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) {
2160  return x1._value() <= x2._value();
2161  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator <= (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) ;
2162  template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator <= (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) {
2163  return x1._value() <= x2._value();
2164  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T1, class A2_OP > static inline bool operator <= (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) ;
2165  template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T1, class A2_OP > static inline bool operator <= (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) {
2166  return x1._value() <= x2._value();
2167  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T2, class A2_OP > static inline bool operator <= (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) ;
2168  template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T2, class A2_OP > static inline bool operator <= (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) {
2169  return x1._value() <= x2._value();
2170  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class DATA_HANDLER_2 > static inline bool operator <= (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) ;
2171  template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class DATA_HANDLER_2 > static inline bool operator <= (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) {
2172  return x1._value() <= x2._value();
2173  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T, class A2_OP > static inline bool operator <= (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) ;
2174  template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T, class A2_OP > static inline bool operator <= (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) {
2175  return x1._value() <= x2._value();
2176  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator <= (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) ;
2177  template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator <= (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) {
2178  return x1._value() <= x2._value();
2179  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T1, class A2_OP > static inline bool operator <= (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) ;
2180  template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T1, class A2_OP > static inline bool operator <= (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) {
2181  return x1._value() <= x2._value();
2182  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T2, class A2_OP > static inline bool operator <= (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) ;
2183  template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T2, class A2_OP > static inline bool operator <= (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) {
2184  return x1._value() <= x2._value();
2185  } template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool operator <= (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const double& x2);
2186  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool operator <= (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const double& x2) {
2187  return x1._value() <= x2;
2188  } template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool operator <= (const double& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x2);
2189  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool operator <= (const double& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x2) {
2190  return x1 <= x2._value();
2191  } template<class AD_TAPE_REAL, class A1_T, class A1_OP > static inline bool operator <= (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const double& x2);
2192  template<class AD_TAPE_REAL, class A1_T, class A1_OP > static inline bool operator <= (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const double& x2) {
2193  return x1._value() <= x2;
2194  } template<class AD_TAPE_REAL, class A1_T, class A1_OP > static inline bool operator <= (const double& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x2);
2195  template<class AD_TAPE_REAL, class A1_T, class A1_OP > static inline bool operator <= (const double& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x2) {
2196  return x1 <= x2._value();
2197  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > static inline bool operator <= (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const double& x2);
2198  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > static inline bool operator <= (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const double& x2) {
2199  return x1._value() <= x2;
2200  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > static inline bool operator <= (const double& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x2);
2201  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > static inline bool operator <= (const double& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x2) {
2202  return x1 <= x2._value();
2203  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP > static inline bool operator <= (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const double& x2);
2204  template<class AD_TAPE_REAL, class A1_T1, class A1_OP > static inline bool operator <= (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const double& x2) {
2205  return x1._value() <= x2;
2206  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP > static inline bool operator <= (const double& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x2);
2207  template<class AD_TAPE_REAL, class A1_T1, class A1_OP > static inline bool operator <= (const double& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x2) {
2208  return x1 <= x2._value();
2209  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP > static inline bool operator <= (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const double& x2);
2210  template<class AD_TAPE_REAL, class A1_T2, class A1_OP > static inline bool operator <= (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const double& x2) {
2211  return x1._value() <= x2;
2212  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP > static inline bool operator <= (const double& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x2);
2213  template<class AD_TAPE_REAL, class A1_T2, class A1_OP > static inline bool operator <= (const double& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x2) {
2214  return x1 <= x2._value();
2215  }
2216  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool operator > (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x2) ;
2217  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool operator > (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x2) {
2218  return x1._value() > x2._value();
2219  } template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T, class A2_OP > static inline bool operator > (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) ;
2220  template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T, class A2_OP > static inline bool operator > (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) {
2221  return x1._value() > x2._value();
2222  } template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T1, class A2_T2, class A2_OP > static inline bool operator > (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) ;
2223  template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T1, class A2_T2, class A2_OP > static inline bool operator > (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) {
2224  return x1._value() > x2._value();
2225  } template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T1, class A2_OP > static inline bool operator > (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) ;
2226  template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T1, class A2_OP > static inline bool operator > (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) {
2227  return x1._value() > x2._value();
2228  } template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T2, class A2_OP > static inline bool operator > (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) ;
2229  template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T2, class A2_OP > static inline bool operator > (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) {
2230  return x1._value() > x2._value();
2231  } template<class AD_TAPE_REAL, class A1_T, class A1_OP, class DATA_HANDLER_2 > static inline bool operator > (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) ;
2232  template<class AD_TAPE_REAL, class A1_T, class A1_OP, class DATA_HANDLER_2 > static inline bool operator > (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) {
2233  return x1._value() > x2._value();
2234  } template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T, class A2_OP > static inline bool operator > (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) ;
2235  template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T, class A2_OP > static inline bool operator > (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) {
2236  return x1._value() > x2._value();
2237  } template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator > (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) ;
2238  template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator > (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) {
2239  return x1._value() > x2._value();
2240  } template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T1, class A2_OP > static inline bool operator > (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) ;
2241  template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T1, class A2_OP > static inline bool operator > (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) {
2242  return x1._value() > x2._value();
2243  } template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T2, class A2_OP > static inline bool operator > (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) ;
2244  template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T2, class A2_OP > static inline bool operator > (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) {
2245  return x1._value() > x2._value();
2246  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class DATA_HANDLER_2 > static inline bool operator > (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) ;
2247  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class DATA_HANDLER_2 > static inline bool operator > (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) {
2248  return x1._value() > x2._value();
2249  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T, class A2_OP > static inline bool operator > (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) ;
2250  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T, class A2_OP > static inline bool operator > (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) {
2251  return x1._value() > x2._value();
2252  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator > (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) ;
2253  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator > (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) {
2254  return x1._value() > x2._value();
2255  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T1, class A2_OP > static inline bool operator > (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) ;
2256  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T1, class A2_OP > static inline bool operator > (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) {
2257  return x1._value() > x2._value();
2258  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T2, class A2_OP > static inline bool operator > (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) ;
2259  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T2, class A2_OP > static inline bool operator > (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) {
2260  return x1._value() > x2._value();
2261  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class DATA_HANDLER_2 > static inline bool operator > (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) ;
2262  template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class DATA_HANDLER_2 > static inline bool operator > (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) {
2263  return x1._value() > x2._value();
2264  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T, class A2_OP > static inline bool operator > (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) ;
2265  template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T, class A2_OP > static inline bool operator > (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) {
2266  return x1._value() > x2._value();
2267  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator > (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) ;
2268  template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator > (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) {
2269  return x1._value() > x2._value();
2270  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T1, class A2_OP > static inline bool operator > (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) ;
2271  template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T1, class A2_OP > static inline bool operator > (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) {
2272  return x1._value() > x2._value();
2273  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T2, class A2_OP > static inline bool operator > (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) ;
2274  template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T2, class A2_OP > static inline bool operator > (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) {
2275  return x1._value() > x2._value();
2276  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class DATA_HANDLER_2 > static inline bool operator > (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) ;
2277  template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class DATA_HANDLER_2 > static inline bool operator > (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) {
2278  return x1._value() > x2._value();
2279  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T, class A2_OP > static inline bool operator > (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) ;
2280  template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T, class A2_OP > static inline bool operator > (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) {
2281  return x1._value() > x2._value();
2282  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator > (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) ;
2283  template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator > (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) {
2284  return x1._value() > x2._value();
2285  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T1, class A2_OP > static inline bool operator > (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) ;
2286  template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T1, class A2_OP > static inline bool operator > (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) {
2287  return x1._value() > x2._value();
2288  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T2, class A2_OP > static inline bool operator > (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) ;
2289  template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T2, class A2_OP > static inline bool operator > (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) {
2290  return x1._value() > x2._value();
2291  } template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool operator > (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const double& x2);
2292  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool operator > (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const double& x2) {
2293  return x1._value() > x2;
2294  } template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool operator > (const double& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x2);
2295  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool operator > (const double& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x2) {
2296  return x1 > x2._value();
2297  } template<class AD_TAPE_REAL, class A1_T, class A1_OP > static inline bool operator > (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const double& x2);
2298  template<class AD_TAPE_REAL, class A1_T, class A1_OP > static inline bool operator > (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const double& x2) {
2299  return x1._value() > x2;
2300  } template<class AD_TAPE_REAL, class A1_T, class A1_OP > static inline bool operator > (const double& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x2);
2301  template<class AD_TAPE_REAL, class A1_T, class A1_OP > static inline bool operator > (const double& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x2) {
2302  return x1 > x2._value();
2303  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > static inline bool operator > (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const double& x2);
2304  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > static inline bool operator > (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const double& x2) {
2305  return x1._value() > x2;
2306  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > static inline bool operator > (const double& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x2);
2307  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > static inline bool operator > (const double& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x2) {
2308  return x1 > x2._value();
2309  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP > static inline bool operator > (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const double& x2);
2310  template<class AD_TAPE_REAL, class A1_T1, class A1_OP > static inline bool operator > (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const double& x2) {
2311  return x1._value() > x2;
2312  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP > static inline bool operator > (const double& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x2);
2313  template<class AD_TAPE_REAL, class A1_T1, class A1_OP > static inline bool operator > (const double& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x2) {
2314  return x1 > x2._value();
2315  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP > static inline bool operator > (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const double& x2);
2316  template<class AD_TAPE_REAL, class A1_T2, class A1_OP > static inline bool operator > (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const double& x2) {
2317  return x1._value() > x2;
2318  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP > static inline bool operator > (const double& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x2);
2319  template<class AD_TAPE_REAL, class A1_T2, class A1_OP > static inline bool operator > (const double& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x2) {
2320  return x1 > x2._value();
2321  }
2322  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool operator >= (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x2) ;
2323  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool operator >= (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x2) {
2324  return x1._value() >= x2._value();
2325  } template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T, class A2_OP > static inline bool operator >= (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) ;
2326  template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T, class A2_OP > static inline bool operator >= (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) {
2327  return x1._value() >= x2._value();
2328  } template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T1, class A2_T2, class A2_OP > static inline bool operator >= (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) ;
2329  template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T1, class A2_T2, class A2_OP > static inline bool operator >= (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) {
2330  return x1._value() >= x2._value();
2331  } template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T1, class A2_OP > static inline bool operator >= (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) ;
2332  template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T1, class A2_OP > static inline bool operator >= (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) {
2333  return x1._value() >= x2._value();
2334  } template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T2, class A2_OP > static inline bool operator >= (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) ;
2335  template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T2, class A2_OP > static inline bool operator >= (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) {
2336  return x1._value() >= x2._value();
2337  } template<class AD_TAPE_REAL, class A1_T, class A1_OP, class DATA_HANDLER_2 > static inline bool operator >= (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) ;
2338  template<class AD_TAPE_REAL, class A1_T, class A1_OP, class DATA_HANDLER_2 > static inline bool operator >= (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) {
2339  return x1._value() >= x2._value();
2340  } template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T, class A2_OP > static inline bool operator >= (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) ;
2341  template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T, class A2_OP > static inline bool operator >= (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) {
2342  return x1._value() >= x2._value();
2343  } template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator >= (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) ;
2344  template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator >= (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) {
2345  return x1._value() >= x2._value();
2346  } template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T1, class A2_OP > static inline bool operator >= (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) ;
2347  template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T1, class A2_OP > static inline bool operator >= (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) {
2348  return x1._value() >= x2._value();
2349  } template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T2, class A2_OP > static inline bool operator >= (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) ;
2350  template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T2, class A2_OP > static inline bool operator >= (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) {
2351  return x1._value() >= x2._value();
2352  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class DATA_HANDLER_2 > static inline bool operator >= (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) ;
2353  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class DATA_HANDLER_2 > static inline bool operator >= (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) {
2354  return x1._value() >= x2._value();
2355  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T, class A2_OP > static inline bool operator >= (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) ;
2356  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T, class A2_OP > static inline bool operator >= (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) {
2357  return x1._value() >= x2._value();
2358  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator >= (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) ;
2359  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator >= (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) {
2360  return x1._value() >= x2._value();
2361  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T1, class A2_OP > static inline bool operator >= (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) ;
2362  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T1, class A2_OP > static inline bool operator >= (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) {
2363  return x1._value() >= x2._value();
2364  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T2, class A2_OP > static inline bool operator >= (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) ;
2365  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T2, class A2_OP > static inline bool operator >= (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) {
2366  return x1._value() >= x2._value();
2367  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class DATA_HANDLER_2 > static inline bool operator >= (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) ;
2368  template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class DATA_HANDLER_2 > static inline bool operator >= (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) {
2369  return x1._value() >= x2._value();
2370  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T, class A2_OP > static inline bool operator >= (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) ;
2371  template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T, class A2_OP > static inline bool operator >= (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) {
2372  return x1._value() >= x2._value();
2373  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator >= (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) ;
2374  template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator >= (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) {
2375  return x1._value() >= x2._value();
2376  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T1, class A2_OP > static inline bool operator >= (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) ;
2377  template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T1, class A2_OP > static inline bool operator >= (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) {
2378  return x1._value() >= x2._value();
2379  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T2, class A2_OP > static inline bool operator >= (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) ;
2380  template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T2, class A2_OP > static inline bool operator >= (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) {
2381  return x1._value() >= x2._value();
2382  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class DATA_HANDLER_2 > static inline bool operator >= (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) ;
2383  template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class DATA_HANDLER_2 > static inline bool operator >= (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2>& x2) {
2384  return x1._value() >= x2._value();
2385  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T, class A2_OP > static inline bool operator >= (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) ;
2386  template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T, class A2_OP > static inline bool operator >= (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP>& x2) {
2387  return x1._value() >= x2._value();
2388  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator >= (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) ;
2389  template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline bool operator >= (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP>& x2) {
2390  return x1._value() >= x2._value();
2391  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T1, class A2_OP > static inline bool operator >= (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) ;
2392  template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T1, class A2_OP > static inline bool operator >= (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP>& x2) {
2393  return x1._value() >= x2._value();
2394  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T2, class A2_OP > static inline bool operator >= (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) ;
2395  template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T2, class A2_OP > static inline bool operator >= (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP>& x2) {
2396  return x1._value() >= x2._value();
2397  } template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool operator >= (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const double& x2);
2398  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool operator >= (const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x1, const double& x2) {
2399  return x1._value() >= x2;
2400  } template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool operator >= (const double& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x2);
2401  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool operator >= (const double& x1, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x2) {
2402  return x1 >= x2._value();
2403  } template<class AD_TAPE_REAL, class A1_T, class A1_OP > static inline bool operator >= (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const double& x2);
2404  template<class AD_TAPE_REAL, class A1_T, class A1_OP > static inline bool operator >= (const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x1, const double& x2) {
2405  return x1._value() >= x2;
2406  } template<class AD_TAPE_REAL, class A1_T, class A1_OP > static inline bool operator >= (const double& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x2);
2407  template<class AD_TAPE_REAL, class A1_T, class A1_OP > static inline bool operator >= (const double& x1, const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x2) {
2408  return x1 >= x2._value();
2409  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > static inline bool operator >= (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const double& x2);
2410  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > static inline bool operator >= (const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x1, const double& x2) {
2411  return x1._value() >= x2;
2412  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > static inline bool operator >= (const double& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x2);
2413  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > static inline bool operator >= (const double& x1, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x2) {
2414  return x1 >= x2._value();
2415  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP > static inline bool operator >= (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const double& x2);
2416  template<class AD_TAPE_REAL, class A1_T1, class A1_OP > static inline bool operator >= (const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x1, const double& x2) {
2417  return x1._value() >= x2;
2418  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP > static inline bool operator >= (const double& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x2);
2419  template<class AD_TAPE_REAL, class A1_T1, class A1_OP > static inline bool operator >= (const double& x1, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x2) {
2420  return x1 >= x2._value();
2421  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP > static inline bool operator >= (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const double& x2);
2422  template<class AD_TAPE_REAL, class A1_T2, class A1_OP > static inline bool operator >= (const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x1, const double& x2) {
2423  return x1._value() >= x2;
2424  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP > static inline bool operator >= (const double& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x2);
2425  template<class AD_TAPE_REAL, class A1_T2, class A1_OP > static inline bool operator >= (const double& x1, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x2) {
2426  return x1 >= x2._value();
2427  }
2428  template<class AD_TAPE_REAL, class DATA_HANDLER_1 >
2430  double tmp = 0;
2431  get(x, tmp);
2432  x = tmp;
2433  }
2434  template<class AD_TAPE_REAL, class DATA_HANDLER_1 >
2435  static inline std::istream &operator >> (std::istream &in, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1> &x) {
2436  AD_TAPE_REAL &tmp = const_cast<AD_TAPE_REAL &>(x._value());
2437  in >> tmp;
2438  return in;
2439  }
2440  using std::ceil;
2441  using std::floor;
2442  using std::isfinite;
2443  using std::isnan;
2444  using std::isinf;
2445  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool isnan(const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x) {
2446  return isnan(x._value());
2447  } template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool isinf(const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x) {
2448  return isinf(x._value());
2449  } template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline double ceil(const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x) {
2450  return ceil(x._value());
2451  } template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline double floor(const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x) {
2452  return floor(x._value());
2453  } template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline bool isfinite(const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x) {
2454  return isfinite(x._value());
2455  }
2456  using std::ceil;
2457  using std::floor;
2458  using std::isfinite;
2459  using std::isnan;
2460  using std::isinf;
2461  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > static inline bool isnan(const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x) {
2462  return isnan(x._value());
2463  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > static inline bool isinf(const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x) {
2464  return isinf(x._value());
2465  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > static inline double ceil(const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x) {
2466  return ceil(x._value());
2467  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > static inline double floor(const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x) {
2468  return floor(x._value());
2469  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > static inline bool isfinite(const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x) {
2470  return isfinite(x._value());
2471  }
2472  using std::ceil;
2473  using std::floor;
2474  using std::isfinite;
2475  using std::isnan;
2476  using std::isinf;
2477  template<class AD_TAPE_REAL, class A1_T1, class A1_OP > static inline bool isnan(const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x) {
2478  return isnan(x._value());
2479  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP > static inline bool isinf(const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x) {
2480  return isinf(x._value());
2481  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP > static inline double ceil(const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x) {
2482  return ceil(x._value());
2483  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP > static inline double floor(const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x) {
2484  return floor(x._value());
2485  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP > static inline bool isfinite(const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x) {
2486  return isfinite(x._value());
2487  }
2488  using std::ceil;
2489  using std::floor;
2490  using std::isfinite;
2491  using std::isnan;
2492  using std::isinf;
2493  template<class AD_TAPE_REAL, class A1_T2, class A1_OP > static inline bool isnan(const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x) {
2494  return isnan(x._value());
2495  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP > static inline bool isinf(const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x) {
2496  return isinf(x._value());
2497  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP > static inline double ceil(const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x) {
2498  return ceil(x._value());
2499  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP > static inline double floor(const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x) {
2500  return floor(x._value());
2501  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP > static inline bool isfinite(const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x) {
2502  return isfinite(x._value());
2503  }
2504  using std::ceil;
2505  using std::floor;
2506  using std::isfinite;
2507  using std::isnan;
2508  using std::isinf;
2509  template<class AD_TAPE_REAL, class A1_T, class A1_OP > static inline bool isnan(const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x) {
2510  return isnan(x._value());
2511  } template<class AD_TAPE_REAL, class A1_T, class A1_OP > static inline bool isinf(const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x) {
2512  return isinf(x._value());
2513  } template<class AD_TAPE_REAL, class A1_T, class A1_OP > static inline double ceil(const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x) {
2514  return ceil(x._value());
2515  } template<class AD_TAPE_REAL, class A1_T, class A1_OP > static inline double floor(const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x) {
2516  return floor(x._value());
2517  } template<class AD_TAPE_REAL, class A1_T, class A1_OP > static inline bool isfinite(const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x) {
2518  return isfinite(x._value());
2519  }
2520  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline std::ostream& operator << (std::ostream& out, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>& x) {
2521  out << x._value();
2522  return out;
2523  }
2524  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > static inline std::ostream& operator << (std::ostream& out, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>& x) {
2525  out << x._value();
2526  return out;
2527  }
2528  template<class AD_TAPE_REAL, class A1_T1, class A1_OP > static inline std::ostream& operator << (std::ostream& out, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>& x) {
2529  out << x._value();
2530  return out;
2531  }
2532  template<class AD_TAPE_REAL, class A1_T2, class A1_OP > static inline std::ostream& operator << (std::ostream& out, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>& x) {
2533  out << x._value();
2534  return out;
2535  }
2536  template<class AD_TAPE_REAL, class A1_T, class A1_OP > static inline std::ostream& operator << (std::ostream& out, const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>& x) {
2537  out << x._value();
2538  return out;
2539  }
2540  }
2541 }
2542 namespace ad {
2543  namespace internal {
2544  template<class T> struct is_not_ad_type {
2545  const static bool RET = true;
2546  };
2547  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > struct is_not_ad_type<ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1> > {
2548  const static bool RET=false;
2549  };
2550  template<class AD_TAPE_REAL, class A1_T, class A1_OP > struct is_not_ad_type<ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP> > {
2551  const static bool RET=false;
2552  };
2553  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > struct is_not_ad_type<ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP> > {
2554  const static bool RET=false;
2555  };
2556  template<class AD_TAPE_REAL, class A1_T1, class A1_OP > struct is_not_ad_type<ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP> > {
2557  const static bool RET=false;
2558  };
2559  template<class AD_TAPE_REAL, class A1_T2, class A1_OP > struct is_not_ad_type<ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP> > {
2560  const static bool RET=false;
2561  };
2562  template <bool condition, class Then, class Else>
2563  struct IF {
2564  typedef Then RET;
2565  };
2566  template <class Then, class Else>
2567  struct IF<false, Then, Else> {
2568  typedef Else RET;
2569  };
2570  template <class T> struct
2571  active_type_of {
2572  typedef T RET;
2573  };
2574  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > struct active_type_of<ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1> > {
2576  };
2577  template<class AD_TAPE_REAL, class A1_T, class A1_OP > struct active_type_of<ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP> > {
2579  };
2580  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > struct active_type_of<ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP> > {
2582  };
2583  template<class AD_TAPE_REAL, class A1_T1, class A1_OP > struct active_type_of<ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP> > {
2585  };
2586  template<class AD_TAPE_REAL, class A1_T2, class A1_OP > struct active_type_of<ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP> > {
2588  };
2589  template<class AD_ARG1, class AD_ARG2>
2591  typedef typename IF<is_not_ad_type<AD_ARG1>::RET, AD_ARG1, typename active_type_of<AD_ARG1>::RET >::RET tmp_type;
2592  typedef typename IF<is_not_ad_type<AD_ARG2>::RET, AD_ARG2, typename active_type_of<AD_ARG2>::RET >::RET tmp_type2;
2594  typedef typename IF<is_not_ad_type<ret_type1>::RET, AD_ARG1, ret_type1>::RET type;
2595  };
2597  if (a > b) return a;
2598  else return b;
2599  } template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline typename min_max_return_type<ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>, ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1> >::type min(const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1> &a, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1> &b) {
2600  if (a < b) return a;
2601  else return b;
2602  }
2604  if (a > b) return a;
2605  else return b;
2606  } template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T, class A2_OP > static inline typename min_max_return_type<ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>, ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP> >::type min(const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1> &a, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP> &b) {
2607  if (a < b) return a;
2608  else return b;
2609  }
2611  if (a > b) return a;
2612  else return b;
2613  } template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T1, class A2_T2, class A2_OP > static inline typename min_max_return_type<ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>, ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP> >::type min(const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1> &a, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP> &b) {
2614  if (a < b) return a;
2615  else return b;
2616  }
2618  if (a > b) return a;
2619  else return b;
2620  } template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T1, class A2_OP > static inline typename min_max_return_type<ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>, ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP> >::type min(const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1> &a, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP> &b) {
2621  if (a < b) return a;
2622  else return b;
2623  }
2625  if (a > b) return a;
2626  else return b;
2627  } template<class AD_TAPE_REAL, class DATA_HANDLER_1, class A2_T2, class A2_OP > static inline typename min_max_return_type<ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>, ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP> >::type min(const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1> &a, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP> &b) {
2628  if (a < b) return a;
2629  else return b;
2630  }
2632  if (a > b) return a;
2633  else return b;
2634  } template<class AD_TAPE_REAL, class A1_T, class A1_OP, class DATA_HANDLER_2 > static inline typename min_max_return_type<ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>, ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2> >::type min(const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP> &a, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2> &b) {
2635  if (a < b) return a;
2636  else return b;
2637  }
2639  if (a > b) return a;
2640  else return b;
2641  } template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T, class A2_OP > static inline typename min_max_return_type<ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>, ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP> >::type min(const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP> &a, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP> &b) {
2642  if (a < b) return a;
2643  else return b;
2644  }
2646  if (a > b) return a;
2647  else return b;
2648  } template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline typename min_max_return_type<ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>, ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP> >::type min(const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP> &a, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP> &b) {
2649  if (a < b) return a;
2650  else return b;
2651  }
2653  if (a > b) return a;
2654  else return b;
2655  } template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T1, class A2_OP > static inline typename min_max_return_type<ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>, ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP> >::type min(const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP> &a, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP> &b) {
2656  if (a < b) return a;
2657  else return b;
2658  }
2660  if (a > b) return a;
2661  else return b;
2662  } template<class AD_TAPE_REAL, class A1_T, class A1_OP, class A2_T2, class A2_OP > static inline typename min_max_return_type<ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>, ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP> >::type min(const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP> &a, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP> &b) {
2663  if (a < b) return a;
2664  else return b;
2665  }
2667  if (a > b) return a;
2668  else return b;
2669  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class DATA_HANDLER_2 > static inline typename min_max_return_type<ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>, ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2> >::type min(const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP> &a, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2> &b) {
2670  if (a < b) return a;
2671  else return b;
2672  }
2674  if (a > b) return a;
2675  else return b;
2676  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T, class A2_OP > static inline typename min_max_return_type<ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>, ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP> >::type min(const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP> &a, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP> &b) {
2677  if (a < b) return a;
2678  else return b;
2679  }
2681  if (a > b) return a;
2682  else return b;
2683  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline typename min_max_return_type<ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>, ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP> >::type min(const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP> &a, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP> &b) {
2684  if (a < b) return a;
2685  else return b;
2686  }
2688  if (a > b) return a;
2689  else return b;
2690  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T1, class A2_OP > static inline typename min_max_return_type<ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>, ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP> >::type min(const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP> &a, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP> &b) {
2691  if (a < b) return a;
2692  else return b;
2693  }
2695  if (a > b) return a;
2696  else return b;
2697  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP, class A2_T2, class A2_OP > static inline typename min_max_return_type<ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>, ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP> >::type min(const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP> &a, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP> &b) {
2698  if (a < b) return a;
2699  else return b;
2700  }
2702  if (a > b) return a;
2703  else return b;
2704  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class DATA_HANDLER_2 > static inline typename min_max_return_type<ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>, ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2> >::type min(const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP> &a, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2> &b) {
2705  if (a < b) return a;
2706  else return b;
2707  }
2709  if (a > b) return a;
2710  else return b;
2711  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T, class A2_OP > static inline typename min_max_return_type<ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>, ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP> >::type min(const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP> &a, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP> &b) {
2712  if (a < b) return a;
2713  else return b;
2714  }
2716  if (a > b) return a;
2717  else return b;
2718  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline typename min_max_return_type<ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>, ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP> >::type min(const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP> &a, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP> &b) {
2719  if (a < b) return a;
2720  else return b;
2721  }
2723  if (a > b) return a;
2724  else return b;
2725  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T1, class A2_OP > static inline typename min_max_return_type<ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>, ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP> >::type min(const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP> &a, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP> &b) {
2726  if (a < b) return a;
2727  else return b;
2728  }
2730  if (a > b) return a;
2731  else return b;
2732  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP, class A2_T2, class A2_OP > static inline typename min_max_return_type<ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>, ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP> >::type min(const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP> &a, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP> &b) {
2733  if (a < b) return a;
2734  else return b;
2735  }
2737  if (a > b) return a;
2738  else return b;
2739  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class DATA_HANDLER_2 > static inline typename min_max_return_type<ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>, ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2> >::type min(const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP> &a, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_2> &b) {
2740  if (a < b) return a;
2741  else return b;
2742  }
2744  if (a > b) return a;
2745  else return b;
2746  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T, class A2_OP > static inline typename min_max_return_type<ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>, ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP> >::type min(const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP> &a, const ad::internal::unary_intermediate<AD_TAPE_REAL, A2_T, A2_OP> &b) {
2747  if (a < b) return a;
2748  else return b;
2749  }
2751  if (a > b) return a;
2752  else return b;
2753  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T1, class A2_T2, class A2_OP > static inline typename min_max_return_type<ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>, ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP> >::type min(const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP> &a, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A2_T1, A2_T2, A2_OP> &b) {
2754  if (a < b) return a;
2755  else return b;
2756  }
2758  if (a > b) return a;
2759  else return b;
2760  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T1, class A2_OP > static inline typename min_max_return_type<ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>, ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP> >::type min(const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP> &a, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A2_T1, A2_OP> &b) {
2761  if (a < b) return a;
2762  else return b;
2763  }
2765  if (a > b) return a;
2766  else return b;
2767  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP, class A2_T2, class A2_OP > static inline typename min_max_return_type<ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>, ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP> >::type min(const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP> &a, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A2_T2, A2_OP> &b) {
2768  if (a < b) return a;
2769  else return b;
2770  }
2771  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline typename min_max_return_type<ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>, AD_TAPE_REAL>::type max(const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1> &a, const AD_TAPE_REAL &b) {
2772  if (a > b) return a;
2773  else return b;
2774  } template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline typename min_max_return_type<ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1>, AD_TAPE_REAL>::type min(const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1> &a, const AD_TAPE_REAL &b) {
2775  if (a < b) return a;
2776  else return b;
2777  }
2778  template<class AD_TAPE_REAL, class A1_T, class A1_OP > static inline typename min_max_return_type<ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>, AD_TAPE_REAL>::type max(const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP> &a, const AD_TAPE_REAL &b) {
2779  if (a > b) return a;
2780  else return b;
2781  } template<class AD_TAPE_REAL, class A1_T, class A1_OP > static inline typename min_max_return_type<ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP>, AD_TAPE_REAL>::type min(const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP> &a, const AD_TAPE_REAL &b) {
2782  if (a < b) return a;
2783  else return b;
2784  }
2785  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > static inline typename min_max_return_type<ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>, AD_TAPE_REAL>::type max(const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP> &a, const AD_TAPE_REAL &b) {
2786  if (a > b) return a;
2787  else return b;
2788  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > static inline typename min_max_return_type<ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP>, AD_TAPE_REAL>::type min(const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP> &a, const AD_TAPE_REAL &b) {
2789  if (a < b) return a;
2790  else return b;
2791  }
2792  template<class AD_TAPE_REAL, class A1_T1, class A1_OP > static inline typename min_max_return_type<ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>, AD_TAPE_REAL>::type max(const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP> &a, const AD_TAPE_REAL &b) {
2793  if (a > b) return a;
2794  else return b;
2795  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP > static inline typename min_max_return_type<ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP>, AD_TAPE_REAL>::type min(const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP> &a, const AD_TAPE_REAL &b) {
2796  if (a < b) return a;
2797  else return b;
2798  }
2799  template<class AD_TAPE_REAL, class A1_T2, class A1_OP > static inline typename min_max_return_type<ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>, AD_TAPE_REAL>::type max(const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP> &a, const AD_TAPE_REAL &b) {
2800  if (a > b) return a;
2801  else return b;
2802  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP > static inline typename min_max_return_type<ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP>, AD_TAPE_REAL>::type min(const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP> &a, const AD_TAPE_REAL &b) {
2803  if (a < b) return a;
2804  else return b;
2805  }
2806  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline typename min_max_return_type<AD_TAPE_REAL, ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1> >::type max(const AD_TAPE_REAL &a, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1> &b) {
2807  if (a > b) return a;
2808  else return b;
2809  } template<class AD_TAPE_REAL, class DATA_HANDLER_1 > static inline typename min_max_return_type<AD_TAPE_REAL, ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1> >::type min(const AD_TAPE_REAL &a, const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1> &b) {
2810  if (a < b) return a;
2811  else return b;
2812  }
2813  template<class AD_TAPE_REAL, class A1_T, class A1_OP > static inline typename min_max_return_type<AD_TAPE_REAL, ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP> >::type max(const AD_TAPE_REAL &a, const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP> &b) {
2814  if (a > b) return a;
2815  else return b;
2816  } template<class AD_TAPE_REAL, class A1_T, class A1_OP > static inline typename min_max_return_type<AD_TAPE_REAL, ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP> >::type min(const AD_TAPE_REAL &a, const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP> &b) {
2817  if (a < b) return a;
2818  else return b;
2819  }
2820  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > static inline typename min_max_return_type<AD_TAPE_REAL, ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP> >::type max(const AD_TAPE_REAL &a, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP> &b) {
2821  if (a > b) return a;
2822  else return b;
2823  } template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > static inline typename min_max_return_type<AD_TAPE_REAL, ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP> >::type min(const AD_TAPE_REAL &a, const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP> &b) {
2824  if (a < b) return a;
2825  else return b;
2826  }
2827  template<class AD_TAPE_REAL, class A1_T1, class A1_OP > static inline typename min_max_return_type<AD_TAPE_REAL, ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP> >::type max(const AD_TAPE_REAL &a, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP> &b) {
2828  if (a > b) return a;
2829  else return b;
2830  } template<class AD_TAPE_REAL, class A1_T1, class A1_OP > static inline typename min_max_return_type<AD_TAPE_REAL, ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP> >::type min(const AD_TAPE_REAL &a, const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP> &b) {
2831  if (a < b) return a;
2832  else return b;
2833  }
2834  template<class AD_TAPE_REAL, class A1_T2, class A1_OP > static inline typename min_max_return_type<AD_TAPE_REAL, ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP> >::type max(const AD_TAPE_REAL &a, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP> &b) {
2835  if (a > b) return a;
2836  else return b;
2837  } template<class AD_TAPE_REAL, class A1_T2, class A1_OP > static inline typename min_max_return_type<AD_TAPE_REAL, ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP> >::type min(const AD_TAPE_REAL &a, const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP> &b) {
2838  if (a < b) return a;
2839  else return b;
2840  }
2841  }
2842 
2843 
2844 }
2845 
2846 
2847 namespace ad {
2848  namespace internal {
2849  template<class AD_TAPE_REAL>
2850  struct ts_data {
2851  typedef AD_TAPE_REAL DERIVATIVE_T;
2852  AD_TAPE_REAL tlm;
2853  ts_data() : tlm(0) {}
2855  tlm = b.tlm;
2856  return *this;
2857  }
2858  inline void clear() {
2859  tlm = 0;
2860  }
2861  inline const AD_TAPE_REAL &_derivative() const
2862  {
2863  (void) "adgt1v";
2864  return tlm;
2865  }
2866  inline AD_TAPE_REAL &_derivative()
2867  {
2868  (void) "adgt1v";
2869  return tlm;
2870  }
2871  template<class AD_INTERMEDIATE, class AD_ACTIVE_TYPE>
2872  static inline void handle(const AD_INTERMEDIATE &vneu, AD_ACTIVE_TYPE &target) {
2873  ts_data &data = const_cast<ts_data &>(target._data());
2874  data.tlm = get_tlm(vneu, 1.0);
2875  }
2876  template<class DATA_HANDLER_1 >
2877  static inline AD_TAPE_REAL get_tlm(const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1> &x, const AD_TAPE_REAL &pval) {
2878  return x._data().tlm * pval;
2879  }
2880  template<class A1_T1, class A1_T2, class A1_OP >
2881  static inline AD_TAPE_REAL get_tlm(const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP> &x, const AD_TAPE_REAL &pval) {
2882  return get_tlm(x._arg1, x.pval1() * pval) + get_tlm(x._arg2, x.pval2() * pval);
2883  }
2884  template<class A1_T, class A1_OP >
2885  static inline AD_TAPE_REAL get_tlm(const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP> &x, const AD_TAPE_REAL &pval) {
2886  return get_tlm(x._arg, x.pval() * pval);
2887  }
2888  template<class A1_T1, class A1_OP >
2889  static inline AD_TAPE_REAL get_tlm(const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP> &x, const AD_TAPE_REAL &pval) {
2890  return get_tlm(x._arg1, x.pval1() * pval);
2891  }
2892  template<class A1_T2, class A1_OP >
2893  static inline AD_TAPE_REAL get_tlm(const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP> &x, const AD_TAPE_REAL &pval) {
2894  return get_tlm(x._arg2, x.pval2() * pval);
2895  }
2896  typedef void DATA_TAPE_TYPE;
2898  inline void *_tape() const {
2899  return NULL;
2900  }
2901  inline AD_TAPE_INT _tape_index() const {
2902  return 0;
2903  }
2904  };
2905  }
2906 }
2907 namespace ad {
2908  namespace internal {
2910  private:
2912  public:
2914  inline AD_TAPE_INT &tapesize() {
2915  return _tapesize;
2916  }
2917  inline const AD_TAPE_INT &tapesize() const {
2918  return _tapesize;
2919  }
2920  };
2921  }
2922 }
2923 namespace ad {
2924  class exception {
2925  public:
2926  template <typename std_exception> static std_exception create(std::string error, std::string file = "", int line = 0) {
2927  std::stringstream S;
2928  S << "--- ad/c++ --- " << error;
2929  if (file != "") S << " --- " << file << ":" << line << ".";
2930  std::cout << "EXCEPTION thrown: " << S.str() << std::endl;
2931  return std_exception(S.str());
2932  }
2933  };
2934 }
2935 namespace ad {
2936  namespace internal {
2937  template <typename AD_TAPE_REAL, class AD_ADJOINT_REAL> struct blob_tape;
2938  }
2939 /*
2940  namespace helper {
2941  template<typename AD_TAPE>
2942  class callback_object_base {
2943  template<typename AD_TAPE_REAL, typename AD_ADJOINT_REAL> friend struct ad::internal::blob_tape;
2944  protected:
2945  inline virtual ~callback_object_base() {
2946  }
2947  AD_TAPE *registered_tape;
2948  public:
2949  inline void set_tape(AD_TAPE *t) {
2950  if (registered_tape != 0) return;
2951  else registered_tape = t;
2952  }
2953  inline AD_TAPE *get_tape() {
2954  return registered_tape;
2955  }
2956  inline callback_object_base() : registered_tape(0) { }
2957  inline virtual double get_memory_size() {
2958  return sizeof(AD_TAPE);
2959  }
2960  };
2961  }
2962 }
2963 */
2964 
2965 
2966  namespace helper {
2967  template<typename AD_TAPE>
2969  template<typename AD_TAPE_REAL, typename AD_ADJOINT_REAL> friend struct ad::internal::blob_tape;
2970  protected:
2971  inline virtual ~callback_object_base() {
2972  }
2974  public:
2975  inline void set_tape(AD_TAPE *t) {
2976  if (registered_tape != 0) return;
2977  else registered_tape = t;
2978  }
2979  inline AD_TAPE *get_tape() {
2980  return registered_tape;
2981  }
2983  inline virtual double get_memory_size() {
2984  return sizeof(AD_TAPE);
2985  }
2986  };
2987  template<class AD_TYPE, class AD_TAPE>
2988  class userdata_object_base : public callback_object_base<AD_TAPE> {
2989  private:
2991  public:
2992  virtual ~template_base_class() {};
2993  virtual double size() = 0;
2994  };
2995  template <typename X>
2997  public:
2998  const X _data;
2999  templated_base_class(const X &d) : _data(d) {}
3000  const X &get_data() const {
3001  return _data;
3002  }
3003  };
3004  template <typename X>
3006  public:
3007  template_class(X data) : templated_base_class<X>(data) {}
3008  virtual ~template_class() { }
3009  virtual double size() {
3010  return sizeof(X);
3011  }
3012  };
3013  template <typename X>
3015  public:
3016  const int _n;
3017  template_vector_class(const X *data, int n) : templated_base_class<X *>(new X[n]), _n(n) {
3018  for (int i = 0; i < n; ++i)
3019  this->_data[i] = data[i];
3020  }
3021  template_vector_class(const X *data, const int inc, const int n) : templated_base_class<X *>(new X[n]), _n(n) {
3022  for (int i = 0, idx = 0; i < n; ++i, idx += inc)
3023  this->_data[i] = data[idx];
3024  }
3026  delete [] this->_data;
3027  }
3028  virtual double size() {
3029  return _n * sizeof(X);
3030  }
3031  };
3032  unsigned int cp_count;
3033  std::vector<template_base_class *> checkpoint;
3034  protected:
3036  for (unsigned int i = 0; i < checkpoint.size(); i++)
3037  delete checkpoint[i];
3038  checkpoint.clear();
3039  }
3040  public:
3042  inline virtual double get_memory_size() {
3044  for (unsigned int i = 0; i < checkpoint.size(); i++)
3045  S += checkpoint[i]->size();
3046  return S;
3047  }
3048  template<typename X>
3049  inline void write_data(const X &cp) {
3050  checkpoint.push_back(new template_class<X>(cp));
3051  }
3052  template<typename X>
3053  inline void write_data(const X *const cp, const int n) {
3054  checkpoint.push_back(new template_vector_class<X>(cp, n));
3055  }
3056  template<typename X>
3057  inline void write_data(const X *const &cp, const int inc, const int n) {
3058  checkpoint.push_back(new template_vector_class<X>(cp, inc, n));
3059  }
3060  template<typename X>
3061  inline const X &read_data() {
3062  const X &cp = static_cast<templated_base_class<X>* >(checkpoint[cp_count])->get_data();
3063  ++cp_count;
3064  if (static_cast<size_t>(cp_count) == checkpoint.size()) cp_count = 0;
3065  return cp;
3066  }
3067  };
3068  template<class AD_TYPE, class AD_TAPE>
3069  class external_adjoint_object_base : public userdata_object_base<AD_TYPE, AD_TAPE> {
3070  protected:
3071  std::vector<AD_TAPE_INT> inputs;
3072  std::vector<AD_TAPE_INT> outputs;
3075  public:
3077  return inputs.size();
3078  }
3080  return outputs.size();
3081  }
3082  public:
3083  inline void check_tape(const AD_TYPE &x) {
3084  if ((x._data()._tape() != 0) && (this->registered_tape != x._data()._tape()))
3085  throw ad::exception::create<std::runtime_error>("impossible binding tape - wrong tape in variable!");
3086  }
3087  protected:
3089  public:
3090  external_adjoint_object_base(const std::pair<int, int> &a): userdata_object_base<AD_TYPE, AD_TAPE>(),
3091  inputs_count(0),
3092  outputs_count(0) {
3093  inputs.reserve(a.first);
3094  outputs.reserve(a.second);
3095  }
3097  }
3098  inline typename AD_TYPE::VALUE_TYPE register_input(const AD_TYPE &x) {
3099  check_tape(x);
3100  inputs.push_back(x._data()._tape_index());
3101  return x._value();
3102  }
3103  inline void register_input(const AD_TYPE *const x, typename AD_TYPE::VALUE_TYPE *values, const int n) {
3104  AD_TAPE_INT oldsize = inputs.size();
3105  inputs.resize(oldsize + n);
3106  AD_TAPE_INT *pos = &inputs[oldsize];
3107  int i;
3108  for (i = 0; i < n; ++i) {
3109  check_tape(x[i]);
3110  pos[i] = x[i]._data()._tape_index();
3111  values[i] = x[i]._value();
3112  }
3113  }
3114  inline void register_input(const std::vector<AD_TYPE> &x, std::vector<typename AD_TYPE::VALUE_TYPE> &values) {
3115  assert(x.size() == values.size());
3116  register_input(&(x[0]), &(values[0]), x.size());
3117  }
3118  inline std::vector<typename AD_TYPE::VALUE_TYPE> register_input(const std::vector<AD_TYPE> &x) {
3119  std::vector<typename AD_TYPE::VALUE_TYPE> values(x.size());
3120  register_input(x, values);
3121  return values;
3122  }
3123  inline void register_output(AD_TYPE *actives, const size_t n) {
3124  if (this->registered_tape == NULL) {
3125  throw ad::exception::create<std::runtime_error>("impossible binding output - no tape available");
3126  } else {
3127  AD_TAPE_INT oldsize = outputs.size();
3128  outputs.resize(oldsize + n);
3129  AD_TAPE_INT *outs = &outputs[ oldsize ];
3130  size_t startindex = 0;
3131  typename AD_TAPE::TAPE_ENTRY *ins = this->registered_tape->_get_insert_ptr_range(n, startindex);
3132  for (size_t i = 0; i < n; ++i) {
3133  ins[i].arg = 0;
3134  typename AD_TYPE::DATA_TYPE &data = actives[i]._data();
3135  data.register_variable(startindex + i, this->registered_tape);
3136  outs[i] = static_cast<AD_TAPE_INT>(startindex + i);
3137  }
3138  }
3139  }
3140  inline void register_output(const typename AD_TYPE::VALUE_TYPE *const pvalues, AD_TYPE *actives, const size_t n) {
3141  if (this->registered_tape == NULL) {
3142  throw ad::exception::create<std::runtime_error>("impossible binding output - no tape available");
3143  } else {
3144  AD_TAPE_INT oldsize = outputs.size();
3145  outputs.resize(oldsize + n);
3146  AD_TAPE_INT *outs = &outputs[ oldsize ];
3147  size_t startindex = 0;
3148  typename AD_TAPE::TAPE_ENTRY *ins = this->registered_tape->_get_insert_ptr_range(n, startindex);
3149  for (size_t i = 0; i < n; ++i) {
3150  ins[i].arg = 0;
3151  actives[i] = pvalues[i];
3152  typename AD_TYPE::DATA_TYPE &data = const_cast<typename AD_TYPE::DATA_TYPE &>(actives[i]._data());
3153  data.register_variable(startindex + i, this->registered_tape);
3154  outs[i] = static_cast<AD_TAPE_INT>(startindex + i);
3155  }
3156  }
3157  }
3158  inline void register_output(const std::vector<typename AD_TYPE::VALUE_TYPE> &pvalues, std::vector<AD_TYPE> &actives) {
3159  assert(pvalues.size() == actives.size());
3160  register_output(&(pvalues[0]), &(actives[0]), pvalues.size());
3161  }
3162  inline std::vector<AD_TYPE> register_output(const std::vector<typename AD_TYPE::VALUE_TYPE> &pvalues) {
3163  std::vector<AD_TYPE> actives(pvalues.size());
3164  register_output(pvalues, actives);
3165  return actives;
3166  }
3167  inline void register_output(std::vector<AD_TYPE> &actives) {
3168  register_output(&(actives[0]), actives.size());
3169  }
3170  inline AD_TYPE register_output(const typename AD_TYPE::VALUE_TYPE &py, AD_TAPE *tape = NULL) {
3171  AD_TYPE y;
3172  if (tape != NULL) {
3173  if (this->registered_tape != NULL && this->registered_tape != tape) {
3174  throw ad::exception::create<std::runtime_error>("impossible binding output in external function (register_output) - tape of inputs and outputs differ!");
3175  }
3176  this->registered_tape = tape;
3177  }
3178  if (this->registered_tape != NULL) {
3179  y = py;
3180  this->registered_tape->register_variable(y);
3181  } else
3182  throw ad::exception::create<std::runtime_error>("impossible binding output in external function - no tape available");
3183  outputs.push_back(y._data()._tape_index());
3184  return y;
3185  }
3186  inline typename AD_TYPE::VALUE_TYPE get_output_adjoint() {
3187  AD_TAPE_INT idx = outputs_count;
3188  outputs_count++;
3189  if (static_cast<size_t>(outputs_count) == outputs.size())
3190  outputs_count = 0;
3191  typename AD_TYPE::VALUE_TYPE back = 0;
3192  back = this->registered_tape->_adjointEx(outputs[static_cast<size_t>(idx)]);
3193  return back;
3194  }
3195  inline void get_output_adjoint(typename AD_TYPE::VALUE_TYPE *buffer, const size_t n) {
3196  AD_TAPE_INT idx = outputs_count;
3197  for (size_t i = 0; i < n; ++i) {
3198  buffer[i] = this->registered_tape->_adjoint(outputs[idx]);
3199  idx++;
3200  }
3201  outputs_count += n;
3202  if (static_cast<size_t>(outputs_count) == outputs.size())
3203  outputs_count = 0;
3204  }
3205  inline void get_output_adjoint(std::vector<typename AD_TYPE::VALUE_TYPE> &buffer) {
3206  assert(buffer.size());
3207  get_output_adjoint(&(buffer[0]), buffer.size());
3208  }
3209  inline void increment_input_adjoint(const typename AD_TYPE::VALUE_TYPE *const adj, const int n) {
3210  for (int i = 0; i < n; ++i) {
3211  this->registered_tape->_adjoint(inputs[inputs_count + i]) += adj[i];
3212  }
3213  inputs_count += n;
3214  if (static_cast<size_t>(inputs_count) == inputs.size())
3215  inputs_count = 0;
3216  }
3217  inline void increment_input_adjoint(const std::vector<typename AD_TYPE::VALUE_TYPE> &adj) {
3218  assert(adj.size() != 0);
3219  increment_input_adjoint(&(adj[0]), adj.size());
3220  }
3221  inline bool all_adjoints_written() {
3222  if (inputs_count == 0) return true;
3223  else return false;
3224  }
3225  inline bool all_adjoints_read() {
3226  if (outputs_count == 0) return true;
3227  else return false;
3228  }
3229  inline void increment_input_adjoint(const typename AD_TYPE::VALUE_TYPE &adj) {
3230  AD_TAPE_INT idx = inputs_count;
3231  inputs_count++;
3232  if (static_cast<size_t>(inputs_count) == inputs.size())
3233  inputs_count = 0;
3234  this->registered_tape->_adjointEx(inputs[static_cast<size_t>(idx)]) += adj;
3235  }
3236  };
3237  }
3238 }
3239 
3240 namespace ad {
3241  template< typename T > struct trait_value {
3242  typedef T RETURN_TYPE;
3243  static inline RETURN_TYPE &value(T &value) {
3244  return value;
3245  }
3246  };
3247  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > struct trait_value <ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1> > {
3250  return value._value();
3251  }
3252  };
3253  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > struct trait_value <const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1> > {
3256  return value._value();
3257  }
3258  };
3259  template<class AD_TAPE_REAL, class A1_T, class A1_OP > struct trait_value <ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP> > {
3262  return value._value();
3263  }
3264  };
3265  template<class AD_TAPE_REAL, class A1_T, class A1_OP > struct trait_value <const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP> > {
3268  return value._value();
3269  }
3270  };
3271  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > struct trait_value <ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP> > {
3274  return value._value();
3275  }
3276  };
3277  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > struct trait_value <const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP> > {
3280  return value._value();
3281  }
3282  };
3283  template<class AD_TAPE_REAL, class A1_T1, class A1_OP > struct trait_value <ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP> > {
3286  return value._value();
3287  }
3288  };
3289  template<class AD_TAPE_REAL, class A1_T1, class A1_OP > struct trait_value <const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP> > {
3292  return value._value();
3293  }
3294  };
3295  template<class AD_TAPE_REAL, class A1_T2, class A1_OP > struct trait_value <ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP> > {
3298  return value._value();
3299  }
3300  };
3301  template<class AD_TAPE_REAL, class A1_T2, class A1_OP > struct trait_value <const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP> > {
3304  return value._value();
3305  }
3306  };
3307  template <typename T>
3308  inline typename trait_value<T>::RETURN_TYPE &value(T &x) {
3309  return trait_value<T>::value(x);
3310  }
3311  template <typename T>
3312  inline typename trait_value<const T>::RETURN_TYPE &value(const T &x) {
3313  return trait_value<const T>::value(x);
3314  }
3315  template< typename T > struct trait_passive_value : trait_value<T> {};
3316  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > struct trait_passive_value <ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1> > {
3320  }
3321  };
3322  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > struct trait_passive_value <const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1> > {
3326  }
3327  };
3328  template<class AD_TAPE_REAL, class A1_T, class A1_OP > struct trait_passive_value <ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP> > {
3332  }
3333  };
3334  template<class AD_TAPE_REAL, class A1_T, class A1_OP > struct trait_passive_value <const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP> > {
3338  }
3339  };
3340  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > struct trait_passive_value <ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP> > {
3344  }
3345  };
3346  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > struct trait_passive_value <const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP> > {
3350  }
3351  };
3352  template<class AD_TAPE_REAL, class A1_T1, class A1_OP > struct trait_passive_value <ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP> > {
3356  }
3357  };
3358  template<class AD_TAPE_REAL, class A1_T1, class A1_OP > struct trait_passive_value <const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP> > {
3362  }
3363  };
3364  template<class AD_TAPE_REAL, class A1_T2, class A1_OP > struct trait_passive_value <ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP> > {
3368  }
3369  };
3370  template<class AD_TAPE_REAL, class A1_T2, class A1_OP > struct trait_passive_value <const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP> > {
3374  }
3375  };
3376  template <typename T>
3379  }
3380  template <typename T>
3381  inline const typename trait_passive_value<T>::RETURN_TYPE &passive_value(const T &x) {
3383  }
3384  template< typename T > struct trait_derivative {
3385  typedef T RETURN_TYPE;
3386  static inline RETURN_TYPE value(const T &vvalue) {
3387  (void) vvalue;
3388  return RETURN_TYPE();
3389  }
3390  };
3391  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > struct trait_derivative <ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1> > {
3394  return value._data()._derivative();
3395  }
3396  };
3397  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > struct trait_derivative <const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1> > {
3400  return const_cast<RETURN_TYPE>(value._data()._derivative());
3401  }
3402  };
3403  template<class AD_TAPE_REAL, class A1_T, class A1_OP > struct trait_derivative <ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP> >;
3404  template<class AD_TAPE_REAL, class A1_T, class A1_OP > struct trait_derivative <const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP> >;
3405  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > struct trait_derivative <ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP> >;
3406  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > struct trait_derivative <const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP> >;
3407  template<class AD_TAPE_REAL, class A1_T1, class A1_OP > struct trait_derivative <ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP> >;
3408  template<class AD_TAPE_REAL, class A1_T1, class A1_OP > struct trait_derivative <const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP> >;
3409  template<class AD_TAPE_REAL, class A1_T2, class A1_OP > struct trait_derivative <ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP> >;
3410  template<class AD_TAPE_REAL, class A1_T2, class A1_OP > struct trait_derivative <const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP> >;
3411  template <typename T>
3412  inline typename trait_derivative<T>::RETURN_TYPE derivative(T &x) {
3413  return trait_derivative<T>::value(x);
3414  }
3415  template <typename T>
3418  }
3419  template< typename T > struct trait_tape_index {
3421  static inline RETURN_TYPE value(const T &vvalue) {
3422  (void) vvalue;
3423  return 0;
3424  }
3425  };
3426  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > struct trait_tape_index <ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1> > {
3429  return value._data()._tape_index();
3430  }
3431  };
3432  template<class AD_TAPE_REAL, class DATA_HANDLER_1 > struct trait_tape_index <const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1> > {
3435  return value._data()._tape_index();
3436  }
3437  };
3438  template<class AD_TAPE_REAL, class A1_T, class A1_OP > struct trait_tape_index <ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP> > {
3441  return value._data()._tape_index();
3442  }
3443  };
3444  template<class AD_TAPE_REAL, class A1_T, class A1_OP > struct trait_tape_index <const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP> > {
3447  return value._data()._tape_index();
3448  }
3449  };
3450  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > struct trait_tape_index <ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP> > {
3453  return value._data()._tape_index();
3454  }
3455  };
3456  template<class AD_TAPE_REAL, class A1_T1, class A1_T2, class A1_OP > struct trait_tape_index <const ad::internal::binary_intermediate_aa<AD_TAPE_REAL, A1_T1, A1_T2, A1_OP> > {
3459  return value._data()._tape_index();
3460  }
3461  };
3462  template<class AD_TAPE_REAL, class A1_T1, class A1_OP > struct trait_tape_index <ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP> > {
3465  return value._data()._tape_index();
3466  }
3467  };
3468  template<class AD_TAPE_REAL, class A1_T1, class A1_OP > struct trait_tape_index <const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP> > {
3471  return value._data()._tape_index();
3472  }
3473  };
3474  template<class AD_TAPE_REAL, class A1_T2, class A1_OP > struct trait_tape_index <ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP> > {
3477  return value._data()._tape_index();
3478  }
3479  };
3480  template<class AD_TAPE_REAL, class A1_T2, class A1_OP > struct trait_tape_index <const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP> > {
3483  return value._data()._tape_index();
3484  }
3485  };
3486  template <typename T>
3488  return trait_tape_index<T>::value(x);
3489  }
3490  template <typename T>
3493  }
3494 }
3495 namespace ad {
3496  namespace internal {
3497  template<class AD_TAPE_REAL, class AD_ADJOINT_REAL = AD_TAPE_REAL>
3498  struct blob_tape {
3499  public:
3500  struct TAPE_ENTRY {
3502  AD_TAPE_REAL pval;
3503  };
3504  struct position_t {
3505  friend struct blob_tape;
3506  private:
3509  position_t(const AD_TAPE_INT nstackcounter, const AD_TAPE_INT nprogvarcounter) : stackcounter(nstackcounter), progvarcounter(nprogvarcounter) {}
3510  public:
3512  inline const AD_TAPE_INT &_stackcounter() const {
3513  return stackcounter;
3514  }
3515  inline const AD_TAPE_INT &_progvarcounter() const {
3516  return progvarcounter;
3517  }
3518  inline bool operator== (const position_t &other) const {
3519  return _stackcounter() == other._stackcounter();
3520  }
3521  inline bool operator> (const position_t &other) const {
3522  return _stackcounter() > other._stackcounter();
3523  }
3524  inline bool operator< (const position_t &other) const {
3525  return _stackcounter() < other._stackcounter();
3526  }
3527  };
3528  private:
3531  AD_ADJOINT_REAL *_adjoints;
3535  bool _isdead;
3537  int _vecidx;
3538  private:
3540  reset();
3541  delete [] _stack;
3542  delete [] _adjoints;
3543  }
3544  public:
3546  }
3547  public:
3549  _topOfStack = end + 1;
3550  }
3551  inline TAPE_ENTRY *_get_insert_ptr(const int num_entries2fill, AD_TAPE_INT &new_tape_index) {
3552  ;
3553  _progvarcounter++;
3554  new_tape_index = _progvarcounter;
3555  TAPE_ENTRY *ret = _topOfStack;
3556  _topOfStack += num_entries2fill;
3557  return ret;
3558  }
3559  inline TAPE_ENTRY *_get_insert_ptr_range(const int num_entries2fill, AD_TAPE_INT &new_tape_index) {
3560  new_tape_index = _progvarcounter + 1;
3561  ;
3562  _progvarcounter += num_entries2fill;
3563  TAPE_ENTRY *ret = _topOfStack;
3564  _topOfStack += num_entries2fill;
3565  return ret;
3566  }
3567  public:
3568  struct interpretation_settings;
3569  private:
3570  void _interpret_chunk(TAPE_ENTRY *start, TAPE_ENTRY *end, AD_TAPE_INT &progvaridx, const interpretation_settings &settings) {
3571  TAPE_ENTRY *cur = start;
3572  if (settings.zeroadjoints) {
3573  while (cur != end) {
3574  cur--;
3575  AD_ADJOINT_REAL &adj = _adjoints[progvaridx];
3576  --progvaridx;
3577  const int &edgecount = cur->arg;
3578  for (int i = 0; i < edgecount; ++i) {
3579  cur--;
3580  _adjoints[cur->arg] += adj * cur->pval;
3581  }
3582  adj = 0;
3583  }
3584  } else {
3585  while (cur != end) {
3586  cur--;
3587  AD_ADJOINT_REAL &adj = _adjoints[progvaridx];
3588  --progvaridx;
3589  const int &edgecount = cur->arg;
3590  for (int i = 0; i < edgecount; ++i) {
3591  cur--;
3592  _adjoints[cur->arg] += adj * cur->pval;
3593  }
3594  }
3595  }
3596  }
3597  inline void _interpret_adjoint_internal_plain(const position_t &from, const position_t &to, const interpretation_settings &settings) {
3598  AD_TAPE_INT progvaridx = from._progvarcounter();
3599  TAPE_ENTRY *start = _stack + from._stackcounter();
3600  TAPE_ENTRY *end = _stack + to._stackcounter();
3601  _interpret_chunk(start, end, progvaridx, settings);
3602  }
3603  inline void _zero_adjoints_internal(const position_t &from, const position_t &to) {
3604  if (_adjoints == 0) return;
3605  for (AD_TAPE_INT i = from._progvarcounter(); i > to._progvarcounter(); --i) {
3606  _adjoints[i] = 0;
3607  }
3608  }
3609  inline void _reset_to_internal(const position_t &to) {
3611  _topOfStack = _stack + to._stackcounter();
3613  }
3614  public:
3615  template<class AD_ACTIVE>
3616  inline void _register_variables_internal(AD_ACTIVE *actives, const typename AD_ACTIVE::VALUE_TYPE *values, int *outs, const int n) {
3617  TAPE_ENTRY *entries = _topOfStack;
3618  ;
3619  AD_TAPE_INT startidx = _progvarcounter + 1;
3620  AD_TAPE_INT i;
3621  typedef typename AD_ACTIVE::DATA_TYPE AD_DATA;
3622  for (i = 0; i < n; ++i) {
3623  entries[i].arg = 0;
3624  if (values) actives[i] = values[i];
3625  if (outs) outs[i] = startidx + i;
3626  AD_DATA &data = const_cast<AD_DATA &>(actives[i]._data());
3627  data.register_variable(startidx + i, this);
3628  }
3629  _topOfStack += n;
3630  ;
3631  _progvarcounter += n;
3632  }
3633  inline position_t get_position() const {
3634  return position_t(static_cast<AD_TAPE_INT>(_topOfStack - _stack), _progvarcounter);
3635  }
3636  inline AD_TAPE_REAL &_adjointEx(const size_t tape_index) {
3637  AD_ADJOINT_REAL &adj = _adjoint(tape_index);
3638  AD_TAPE_REAL *adjvec;
3639  adjvec = reinterpret_cast<AD_TAPE_REAL *>(&adj);
3640  return adjvec[_vecidx];
3641  }
3642  inline AD_ADJOINT_REAL &_adjoint(const size_t tape_index) {
3643  return _adjoints[tape_index];
3644  }
3645  inline double get_checkpoint_memory_size() {
3646  double checkpoint_size = 0;
3647  for (AD_TAPE_INT i = 0; i < tape_callbacks.size(); i++)
3648  checkpoint_size += tape_callbacks[i].userdata->get_memory_size();
3649  return checkpoint_size / 1024.0 / 1024.0;
3650  }
3651  inline size_t get_tape_memory_size() const {
3652  return (get_position()._progvarcounter() * sizeof(AD_TAPE_REAL) + get_position()._stackcounter() * sizeof(TAPE_ENTRY));
3653  }
3654  inline double get_allocated_tape_memory_size() const {
3655  return ((_adjoint_size / 1024.0 / 1024.0) * sizeof(AD_TAPE_REAL) + (_stack_size / 1024.0 / 1024.0) * sizeof(TAPE_ENTRY));
3656  }
3657  inline size_t _get_tape_memory() const {
3658  return (((get_position()._progvarcounter()) * sizeof(AD_TAPE_REAL)) + ((get_position()._stackcounter()) * sizeof(TAPE_ENTRY)));
3659  }
3661  return create(options.tapesize());
3662  }
3663  static blob_tape *create(AD_TAPE_INT size, AD_TAPE_INT progvarcounter = 0) {
3664  if (progvarcounter == 0) progvarcounter = size / 2;
3665  blob_tape *ret = new blob_tape();
3666  ret->_stack = new TAPE_ENTRY[size + 1];
3667  ret->_topOfStack = ret->_stack;
3668  ret->_adjoints = new AD_ADJOINT_REAL[progvarcounter + 1];
3669  for (AD_TAPE_INT i = 0; i <= progvarcounter; i++)
3670  ret->_adjoints[i] = 0;
3671  ret->_stack_size = size;
3672  ret->_adjoint_size = progvarcounter;
3673  ret->_isactive = true;
3674  for (AD_TAPE_INT i = 0; i <= size; ++i) {
3675  ret->_stack[i].arg = 0;
3676  ret->_stack[i].pval = 0;
3677  }
3678  return ret;
3679  }
3680  static void remove(blob_tape *&tape) {
3681  if (tape == 0) return;
3682  delete tape;
3683  tape = 0;
3684  }
3686  public:
3688  bool reset;
3691  };
3693 
3694  template <typename EXT_DATA>
3696  public:
3697  typedef void (*TAPE_CALLBACK_w_all_base)(AD_TAPE_CLASS &caller, const interpretation_settings &s, EXT_DATA *userdata);
3698  typedef void (*TAPE_CALLBACK_w_tape_base)(AD_TAPE_CLASS &caller, EXT_DATA *userdata);
3699  typedef void (*TAPE_CALLBACK_plain_base)(EXT_DATA *userdata);
3700  };
3702  public:
3703  virtual void run_callback(AD_TAPE_CLASS &caller, const interpretation_settings &s, callback_object_t *userdata) = 0;
3705  };
3706  template <typename EXT_DATA>
3708  private:
3709  union {
3713  } fcn;
3715  public:
3717  fcn.fcn = fcn_;
3718  }
3720  fcn.fcn_w_tape = fcn_;
3721  }
3723  fcn.fcn_w_all = fcn_;
3724  }
3726  EXT_DATA *casted_userdata = static_cast<EXT_DATA *>(userdata);
3727  switch (fcn_type_id) {
3728  case 0:
3729  fcn.fcn(casted_userdata);
3730  break;
3731  case 1:
3732  fcn.fcn_w_tape(caller, casted_userdata);
3733  break;
3734  case 2:
3735  fcn.fcn_w_all(caller, s, casted_userdata);
3736  break;
3737  default:
3738  throw ad::exception::create<std::runtime_error>("unknown callback to run.");
3739  break;
3740  }
3741  }
3743  };
3748  public:
3750  callback_handler(0) { }
3751  template <typename EXT_DATA, typename FCN_CALLBACK>
3752  void set_callback(FCN_CALLBACK fcn_) {
3753  if (callback_handler)
3754  throw ad::exception::create<std::runtime_error>("currently not supported to insert external_adjoint_object_bases twice.");
3756  }
3758  return userdata;
3759  }
3760  void free_userdata() {
3761  delete userdata;
3762  if (callback_handler)
3763  delete callback_handler;
3764  }
3766  return position;
3767  }
3769  if (callback_handler)
3770  callback_handler->run_callback(caller, s, userdata);
3771  }
3772  };
3773  std::vector<tape_callback> tape_callbacks;
3774  template <class ext_fcn_data_type, typename FCN_PARAMETERS>
3775  inline ext_fcn_data_type *create_callback_object(const FCN_PARAMETERS &parameters) {
3776  const reference_constructor_wrapper<FCN_PARAMETERS> ref_wrapper(parameters);
3777  tape_callback external_fcn;
3778  tape_callbacks.push_back(external_fcn);
3779  tape_callbacks.back()._position() = get_position();
3780  ext_fcn_data_type *userdata = ref_wrapper.template create<ext_fcn_data_type>();
3781  tape_callbacks.back()._userdata() = userdata;
3782  userdata->set_tape(this);
3783  return userdata;
3784  }
3785  template <class ext_fcn_data_type>
3786  inline ext_fcn_data_type *create_callback_object() {
3787  void *dummy;
3788  return create_callback_object<ext_fcn_data_type>(dummy);
3789  }
3790  template <class ext_fcn_data_type, typename FCN_CALLBACK>
3791  inline void insert_callback(FCN_CALLBACK callback_handler, ext_fcn_data_type *D) {
3792  if (tape_callbacks.back()._userdata() == D) {
3793  tape_callbacks.back().template set_callback<ext_fcn_data_type>(callback_handler);
3794  tape_callbacks.back()._position() = get_position();
3795  AD_TAPE_INT tmp = 0;
3796  _get_insert_ptr(1, tmp)->arg = 0;
3797  } else {
3798  throw ad::exception::create<std::runtime_error>("please always insert most recently created external function object.");
3799  }
3800  }
3801  private:
3802  inline void _reset_tape_callbacks_to(const position_t &to) {
3803  for (int i = static_cast<int>(tape_callbacks.size()) - 1; i >= 0; i--) {
3804  size_t offset = static_cast<size_t>(i);
3805  if (tape_callbacks[offset]._position()._progvarcounter() > to._progvarcounter()) {
3806  tape_callbacks[offset].free_userdata();
3807  tape_callbacks.pop_back();
3808  } else {
3809  break;
3810  }
3811  }
3812  }
3813  private:
3814  inline void _interpret_adjoint_internal(const position_t &from, const position_t &to, const interpretation_settings &settings)
3815  {
3816  if (from > get_position())
3817  throw ad::exception::create<std::runtime_error>("you try to use a tape position outside of the current tape. error.");
3818  _adjoint(static_cast<AD_TAPE_INT>(from._progvarcounter()));
3819  int external_first = -1;
3820  int external_count = 0;
3821  for (int i = static_cast<int>(tape_callbacks.size()) - 1; i >= 0; --i) {
3822  size_t offset = static_cast<size_t>(i);
3823  if ((tape_callbacks[offset]._position()._progvarcounter() <= from._progvarcounter()) &&
3824  (tape_callbacks[offset]._position()._progvarcounter() >= to._progvarcounter())) {
3825  if (external_first == -1) external_first = i;
3826  ++external_count;
3827  }
3828  }
3829  position_t myfrom = from;
3830  position_t myto;
3831  for (int i = external_first; external_count > 0; --external_count) {
3832  size_t offset = static_cast<size_t>(i);
3833  myto = tape_callbacks[offset]._position();
3834  _interpret_adjoint_internal_plain(myfrom, myto, settings);
3835  if (settings.reset) {
3836  _reset_to_internal(myto);
3837  AD_TAPE_INT nti;
3838  TAPE_ENTRY *cur = _get_insert_ptr(1, nti);
3839  (void) cur;
3840  }
3841  tape_callbacks[offset].run_callback(*this, settings);
3842  if (settings.reset) {
3843  _reset_to_internal(myto);
3844  tape_callbacks[offset].free_userdata();
3845  tape_callbacks.pop_back();
3846  }
3847  myfrom = myto;
3848  --i;
3849  }
3850  _interpret_adjoint_internal_plain(myfrom, to, settings);
3851  }
3852  public:
3853  inline bool is_active() {
3854  return _isactive;
3855  }
3856  inline void switch_to_active() {
3857  if (!_isactive) _isactive = true;
3858  }
3859  inline void switch_to_passive() {
3860  if (_isactive) _isactive = false;
3861  }
3862  template<class DATA_HANDLER_1 >
3864  AD_TAPE_INT new_tape_index;
3865  TAPE_ENTRY *cur = _get_insert_ptr(1, new_tape_index);
3866  (void) cur;
3867  cur->arg = 0;
3868  DATA_HANDLER_1 &data = const_cast<DATA_HANDLER_1 &>(x._data());
3869  data.register_variable(new_tape_index, this);
3870  }
3871  template<class DATA_HANDLER_1 >
3873  x = v;
3874  register_variable(x);
3875  }
3876  template<class DATA_HANDLER_1 >
3878  for (size_t i = 0; i < x.size(); i++)
3879  register_variable(x[i]);
3880  }
3881  template<class DATA_HANDLER_1 >
3883  if (n == 0) return;
3884  for (int i = 0; i < n; ++i)
3885  register_variable(x[i], v[i]);
3886  }
3887  template<class DATA_HANDLER_1 >
3889  if (n == 0) return;
3890  for (size_t i = 0; i < n; ++i)
3891  register_variable(x[i]);
3892  }
3893  template<class DATA_HANDLER_1 >
3896  }
3897  template<class DATA_HANDLER_1 >
3899  if (n == 0) return;
3900  for (size_t i = 0; i < n; ++i)
3901  x[i] = static_cast<ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1> >(1.0) * x[i];
3902  }
3903  template<class DATA_HANDLER_1 >
3905  for (size_t i = 0; i < x.size(); i++)
3907  }
3908  inline void reset_to(const position_t &to) {
3909  _reset_to_internal(to);
3911  }
3912  inline void reset() {
3913  reset_to(position_t());
3914  }
3915  inline void interpret_adjoint() {
3916  position_t to;
3917  interpretation_settings settings;
3918  _interpret_adjoint_internal(get_position(), to, settings);
3919  }
3920  inline void interpret_adjoint_to(const position_t &to) {
3921  interpretation_settings settings;
3922  if (to > get_position())
3923  throw ad::exception::create<std::runtime_error>("adjoint interpretation: from < to.", "../build_files//../src/ad//ad_tape_interface_inc.hpp", 241);
3924  else
3925  _interpret_adjoint_internal(get_position(), to, settings);
3926  }
3927  inline void interpret_adjoint_from(const position_t &from) {
3928  position_t to;
3929  assert(!(from < to));
3930  interpretation_settings settings;
3931  _interpret_adjoint_internal(from, to, settings);
3932  }
3933  inline void interpret_adjoint_from_to(const position_t &from, const position_t &to) {
3934  interpretation_settings settings;
3935  if (to > from)
3936  throw ad::exception::create<std::runtime_error>("adjoint interpretation: from < to.", "../build_files//../src/ad//ad_tape_interface_inc.hpp", 264);
3937  else
3938  _interpret_adjoint_internal(from, to, settings);
3939  }
3941  position_t from(get_position());
3942  interpretation_settings settings;
3943  settings.reset = true;
3944  settings.zeroadjoints = true;
3945  _interpret_adjoint_internal(from, to, settings);
3946  _reset_to_internal(to);
3948  }
3950  position_t from(get_position());
3951  interpretation_settings settings;
3952  settings.reset = false;
3953  settings.zeroadjoints = true;
3954  _interpret_adjoint_internal(from, to, settings);
3955  }
3957  interpretation_settings settings;
3958  settings.reset = false;
3959  settings.zeroadjoints = true;
3960  _interpret_adjoint_internal(from, to, settings);
3961  }
3962  inline void zero_adjoints() {
3963  position_t to;
3965  }
3966  inline void zero_adjoints_to(const position_t &to) {
3968  }
3969  inline void zero_adjoints_from(const position_t &from) {
3970  position_t to;
3971  _zero_adjoints_internal(from, to);
3972  }
3973  inline void zero_adjoints_from_to(const position_t &from, const position_t &to) {
3974  _zero_adjoints_internal(from, to);
3975  }
3976  struct handler_base {
3977  protected:
3978  template<class DATA_HANDLER_1 >
3980  return x._data()._edgecount();
3981  }
3982  template<class A1_T1, class A1_T2, class A1_OP >
3984  return _get_edge_count(x._arg1) + _get_edge_count(x._arg2);
3985  }
3986  template<class A1_T, class A1_OP >
3988  return _get_edge_count(x._arg);
3989  }
3990  template<class A1_T1, class A1_OP >
3992  return _get_edge_count(x._arg1);
3993  }
3994  template<class A1_T2, class A1_OP >
3996  return _get_edge_count(x._arg2);
3997  }
3998  struct tapehandler {
4000  template<class AD_INTERMEDIATE>
4001  tapehandler(TAPE_ENTRY *ins_ptr, const int edgecount, AD_INTERMEDIATE vneu) : _ins_ptr(ins_ptr) {
4002  interpret(vneu, 1.0);
4003  _ins_ptr->arg = edgecount;
4004  }
4005  template<class DATA_HANDLER_1 >
4006  inline void interpret(const ad::internal::active_type<AD_TAPE_REAL, DATA_HANDLER_1> &x, const AD_TAPE_REAL &pval) {
4007  if (x._data()._tape_index() != 0) {
4008  _ins_ptr->arg = x._data()._tape_index();
4009  _ins_ptr->pval = pval;
4010  ++_ins_ptr;
4011  }
4012  }
4013  template<class A1_T1, class A1_T2, class A1_OP >
4015  this->interpret(x._arg1, x.pval1()*pval);
4016  this->interpret(x._arg2, x.pval2()*pval);
4017  }
4018  template<class A1_T, class A1_OP >
4019  inline void interpret(const ad::internal::unary_intermediate<AD_TAPE_REAL, A1_T, A1_OP> &x, const AD_TAPE_REAL &pval) {
4020  this->interpret(x._arg, x.pval() * pval);
4021  }
4022  template<class A1_T1, class A1_OP >
4023  inline void interpret(const ad::internal::binary_intermediate_ap<AD_TAPE_REAL, A1_T1, A1_OP> &x, const AD_TAPE_REAL &pval) {
4024  this->interpret(x._arg1, x.pval1()*pval);
4025  }
4026  template<class A1_T2, class A1_OP >
4027  inline void interpret(const ad::internal::binary_intermediate_pa<AD_TAPE_REAL, A1_T2, A1_OP> &x, const AD_TAPE_REAL &pval) {
4028  this->interpret(x._arg2, x.pval2()*pval);
4029  }
4030  };
4031  };
4032  template<AD_TAPE_CLASS *&global_tape>
4036  typedef AD_ADJOINT_REAL DERIVATIVE_T;
4038  public:
4040  inline void clear() {
4041  _tape_index_ = 0;
4042  }
4043  inline const AD_ADJOINT_REAL &_derivative() const {
4044  return _adjoint();
4045  }
4046  inline AD_ADJOINT_REAL &_derivative() {
4047  return _adjoint();
4048  }
4049  inline AD_ADJOINT_REAL &_adjoint() const {
4050  return global_tape->_adjoint(_tape_index_);
4051  }
4052  inline bool _is_registered() const {
4053  return _tape_index_ == 0 ? false : true;
4054  }
4056  return _tape_index_;
4057  }
4058  inline const AD_TAPE_INT &_tape_index() const {
4059  return _tape_index_;
4060  }
4061  inline int _edgecount() const {
4062  return _tape_index_ == 0 ? 0 : 1;
4063  }
4064  inline void register_variable(AD_TAPE_INT new_tape_index, AD_TAPE_CLASS *tape) {
4065  (void) tape;
4066  _tape_index_ = new_tape_index;
4067  }
4068  template<class AD_INTERMEDIATE, class AD_ACTIVE_TYPE>
4069  static inline void handle(const AD_INTERMEDIATE &vneu, AD_ACTIVE_TYPE &target) {
4070  int edgecount = handler_base::_get_edge_count(vneu);
4071  if (edgecount > 0) {
4072  if (NULL != global_tape && !global_tape->is_active()) {
4073  single_tape_data &data = const_cast<single_tape_data &>(target._data());
4074  data.clear();
4075  return;
4076  }
4077  AD_TAPE_INT newTapeIndex;
4078  typename AD_TAPE_CLASS::TAPE_ENTRY *ins_ptr = global_tape->_get_insert_ptr(edgecount + 1, newTapeIndex);
4079  if (ins_ptr != 0) {
4080  typename handler_base::tapehandler tmp(ins_ptr, edgecount, vneu);
4081  }
4082  single_tape_data &data = const_cast<single_tape_data &>(target._data());
4083  data._tape_index_ = newTapeIndex;
4084  } else {
4085  single_tape_data &data = const_cast<single_tape_data &>(target._data());
4086  data.clear();
4087  }
4088  }
4089  static inline AD_TAPE_CLASS *_tape() {
4090  return global_tape;
4091  }
4092  inline void _set_tape(AD_TAPE_CLASS *T) {
4093  (void) T;
4094  }
4095  };
4096  };
4097  }
4098 }
4099 namespace ad {
4100  template <class VALUE_T>
4101  class gvalue {
4102  public:
4103  typedef VALUE_T value_t;
4104  typedef VALUE_T active_t;
4105  typedef VALUE_T passive_t;
4106  typedef VALUE_T type;
4107  typedef void derivative_t;
4108  typedef void tape_t;
4109  static const bool is_ad_type = false;
4110  static const bool is_adjoint_type = false;
4111  static const bool is_tangent_type = false;
4112  static const int order = 0;
4113  };
4114  template <class DcoT>
4115  struct mode : public ad::gvalue<DcoT> {};
4116 
4117  template <class T>
4118  class gt1s {
4119  public:
4120  typedef T value_t;
4121  typedef T derivative_t;
4125  typedef void tape_t;
4126  static const bool is_ad_type = true;
4127  static const bool is_adjoint_type = false;
4128  static const bool is_tangent_type = true;
4129  static const int order = ad::mode<T>::order + 1;
4130  };
4131  template <class T>
4132  class ga1s {
4133  public:
4134  typedef T value_t;
4135  typedef T derivative_t;
4139  typedef typename tape_t::template single_tape_data<global_tape> _data;
4146  static const bool is_ad_type = true;
4147  static const bool is_adjoint_type = true;
4148  static const bool is_tangent_type = false;
4149  static const int order = ad::mode<T>::order + 1;
4150  };
4151  template <typename T> typename ga1s<T>::tape_t *ga1s<T>::global_tape;
4152 }
4153 namespace ad {
4154  template<typename tape_t>
4155  static size_t size_of(const tape_t *tape) {
4156  return tape->_get_tape_memory();
4157  }
4158  template <typename AD_TAPE_REAL>
4159  struct mode<ad::internal::active_type<AD_TAPE_REAL, typename ad::gt1s<AD_TAPE_REAL>::_data> > : public ad::gt1s<AD_TAPE_REAL> {};
4160  template <typename AD_TAPE_REAL>
4161  struct mode<ad::internal::active_type<AD_TAPE_REAL, typename ad::ga1s<AD_TAPE_REAL>::_data> > : public ad::ga1s<AD_TAPE_REAL> {};
4162 }
4163 
4164 #endif
#define AD_DEFAULT_TAPE_SIZE
Definition: ad.hpp:83
long int AD_TAPE_INT
Definition: ad.hpp:88
Definition: ad.hpp:2924
static std_exception create(std::string error, std::string file="", int line=0)
Definition: ad.hpp:2926
Definition: ad.hpp:4132
mode< value_t >::passive_t passive_t
Definition: ad.hpp:4136
tape_t::template single_tape_data< global_tape > _data
Definition: ad.hpp:4139
ad::helper::userdata_object_base< type, tape_t > userdata_object_t
Definition: ad.hpp:4143
static const bool is_ad_type
Definition: ad.hpp:4146
ad::internal::blob_tape< derivative_t > tape_t
Definition: ad.hpp:4137
T value_t
Definition: ad.hpp:4134
ad::helper::callback_object_base< tape_t > callback_object_t
Definition: ad.hpp:4142
ad::internal::active_type< T, _data > type
Definition: ad.hpp:4140
T derivative_t
Definition: ad.hpp:4135
static const bool is_adjoint_type
Definition: ad.hpp:4147
static const bool is_tangent_type
Definition: ad.hpp:4148
ad::internal::tape_options tape_options_t
Definition: ad.hpp:4141
static tape_t * global_tape
Definition: ad.hpp:4138
external_adjoint_object_t efo_t
Definition: ad.hpp:4145
static const int order
Definition: ad.hpp:4149
ad::helper::external_adjoint_object_base< type, tape_t > external_adjoint_object_t
Definition: ad.hpp:4144
Definition: ad.hpp:4118
static const bool is_ad_type
Definition: ad.hpp:4126
T derivative_t
Definition: ad.hpp:4121
static const int order
Definition: ad.hpp:4129
T value_t
Definition: ad.hpp:4120
static const bool is_tangent_type
Definition: ad.hpp:4128
ad::internal::ts_data< derivative_t > _data
Definition: ad.hpp:4123
mode< value_t >::passive_t passive_t
Definition: ad.hpp:4122
void tape_t
Definition: ad.hpp:4125
static const bool is_adjoint_type
Definition: ad.hpp:4127
ad::internal::active_type< T, _data > type
Definition: ad.hpp:4124
Definition: ad.hpp:4101
VALUE_T passive_t
Definition: ad.hpp:4105
static const bool is_tangent_type
Definition: ad.hpp:4111
void derivative_t
Definition: ad.hpp:4107
static const int order
Definition: ad.hpp:4112
void tape_t
Definition: ad.hpp:4108
VALUE_T type
Definition: ad.hpp:4106
static const bool is_adjoint_type
Definition: ad.hpp:4110
VALUE_T value_t
Definition: ad.hpp:4103
VALUE_T active_t
Definition: ad.hpp:4104
static const bool is_ad_type
Definition: ad.hpp:4109
Definition: ad.hpp:2968
virtual ~callback_object_base()
Definition: ad.hpp:2971
AD_TAPE * get_tape()
Definition: ad.hpp:2979
callback_object_base()
Definition: ad.hpp:2982
virtual double get_memory_size()
Definition: ad.hpp:2983
AD_TAPE * registered_tape
Definition: ad.hpp:2973
void set_tape(AD_TAPE *t)
Definition: ad.hpp:2975
void get_output_adjoint(typename AD_TYPE::VALUE_TYPE *buffer, const size_t n)
Definition: ad.hpp:3195
void register_input(const AD_TYPE *const x, typename AD_TYPE::VALUE_TYPE *values, const int n)
Definition: ad.hpp:3103
void increment_input_adjoint(const typename AD_TYPE::VALUE_TYPE &adj)
Definition: ad.hpp:3229
std::vector< AD_TAPE_INT > inputs
Definition: ad.hpp:3071
void register_output(const std::vector< typename AD_TYPE::VALUE_TYPE > &pvalues, std::vector< AD_TYPE > &actives)
Definition: ad.hpp:3158
size_t get_number_of_registered_outputs()
Definition: ad.hpp:3079
void increment_input_adjoint(const typename AD_TYPE::VALUE_TYPE *const adj, const int n)
Definition: ad.hpp:3209
void increment_input_adjoint(const std::vector< typename AD_TYPE::VALUE_TYPE > &adj)
Definition: ad.hpp:3217
void register_output(std::vector< AD_TYPE > &actives)
Definition: ad.hpp:3167
std::vector< typename AD_TYPE::VALUE_TYPE > register_input(const std::vector< AD_TYPE > &x)
Definition: ad.hpp:3118
AD_TYPE::VALUE_TYPE register_input(const AD_TYPE &x)
Definition: ad.hpp:3098
void register_input(const std::vector< AD_TYPE > &x, std::vector< typename AD_TYPE::VALUE_TYPE > &values)
Definition: ad.hpp:3114
void get_output_adjoint(std::vector< typename AD_TYPE::VALUE_TYPE > &buffer)
Definition: ad.hpp:3205
size_t get_number_of_registered_inputs()
Definition: ad.hpp:3076
AD_TAPE_INT inputs_count
Definition: ad.hpp:3073
void register_output(AD_TYPE *actives, const size_t n)
Definition: ad.hpp:3123
AD_TYPE::VALUE_TYPE get_output_adjoint()
Definition: ad.hpp:3186
external_adjoint_object_base(const std::pair< int, int > &a)
Definition: ad.hpp:3090
bool all_adjoints_written()
Definition: ad.hpp:3221
~external_adjoint_object_base()
Definition: ad.hpp:3088
void check_tape(const AD_TYPE &x)
Definition: ad.hpp:3083
AD_TAPE_INT outputs_count
Definition: ad.hpp:3074
AD_TYPE register_output(const typename AD_TYPE::VALUE_TYPE &py, AD_TAPE *tape=NULL)
Definition: ad.hpp:3170
external_adjoint_object_base()
Definition: ad.hpp:3096
std::vector< AD_TYPE > register_output(const std::vector< typename AD_TYPE::VALUE_TYPE > &pvalues)
Definition: ad.hpp:3162
std::vector< AD_TAPE_INT > outputs
Definition: ad.hpp:3072
void register_output(const typename AD_TYPE::VALUE_TYPE *const pvalues, AD_TYPE *actives, const size_t n)
Definition: ad.hpp:3140
bool all_adjoints_read()
Definition: ad.hpp:3225
virtual ~template_base_class()
Definition: ad.hpp:2992
virtual ~template_class()
Definition: ad.hpp:3008
virtual double size()
Definition: ad.hpp:3009
template_class(X data)
Definition: ad.hpp:3007
template_vector_class(const X *data, int n)
Definition: ad.hpp:3017
template_vector_class(const X *data, const int inc, const int n)
Definition: ad.hpp:3021
virtual ~template_vector_class()
Definition: ad.hpp:3025
virtual double size()
Definition: ad.hpp:3028
templated_base_class(const X &d)
Definition: ad.hpp:2999
const X & get_data() const
Definition: ad.hpp:3000
Definition: ad.hpp:2988
virtual ~userdata_object_base()
Definition: ad.hpp:3035
unsigned int cp_count
Definition: ad.hpp:3032
void write_data(const X *const &cp, const int inc, const int n)
Definition: ad.hpp:3057
std::vector< template_base_class * > checkpoint
Definition: ad.hpp:3033
void write_data(const X *const cp, const int n)
Definition: ad.hpp:3053
virtual double get_memory_size()
Definition: ad.hpp:3042
userdata_object_base()
Definition: ad.hpp:3041
void write_data(const X &cp)
Definition: ad.hpp:3049
const X & read_data()
Definition: ad.hpp:3061
void(* TAPE_CALLBACK_plain_base)(EXT_DATA *userdata)
Definition: ad.hpp:3699
void(* TAPE_CALLBACK_w_tape_base)(AD_TAPE_CLASS &caller, EXT_DATA *userdata)
Definition: ad.hpp:3698
void(* TAPE_CALLBACK_w_all_base)(AD_TAPE_CLASS &caller, const interpretation_settings &s, EXT_DATA *userdata)
Definition: ad.hpp:3697
virtual void run_callback(AD_TAPE_CLASS &caller, const interpretation_settings &s, callback_object_t *userdata)=0
virtual ~CALLBACK_FCN_HANDLER_BASE()
Definition: ad.hpp:3704
CALLBACK_DATA_POINTER< EXT_DATA >::TAPE_CALLBACK_w_tape_base fcn_w_tape
Definition: ad.hpp:3711
CALLBACK_DATA_POINTER< EXT_DATA >::TAPE_CALLBACK_w_all_base fcn_w_all
Definition: ad.hpp:3712
CALLBACK_FCN_HANDLER(typename CALLBACK_DATA_POINTER< EXT_DATA >::TAPE_CALLBACK_w_all_base fcn_)
Definition: ad.hpp:3722
CALLBACK_DATA_POINTER< EXT_DATA >::TAPE_CALLBACK_plain_base fcn
Definition: ad.hpp:3710
CALLBACK_FCN_HANDLER(typename CALLBACK_DATA_POINTER< EXT_DATA >::TAPE_CALLBACK_plain_base fcn_)
Definition: ad.hpp:3716
CALLBACK_FCN_HANDLER(typename CALLBACK_DATA_POINTER< EXT_DATA >::TAPE_CALLBACK_w_tape_base fcn_)
Definition: ad.hpp:3719
void run_callback(AD_TAPE_CLASS &caller, const interpretation_settings &s, callback_object_t *userdata)
Definition: ad.hpp:3725
~CALLBACK_FCN_HANDLER()
Definition: ad.hpp:3742
void run_callback(AD_TAPE_CLASS &caller, const interpretation_settings &s)
Definition: ad.hpp:3768
CALLBACK_FCN_HANDLER_BASE * callback_handler
Definition: ad.hpp:3746
callback_object_t * userdata
Definition: ad.hpp:3745
void set_callback(FCN_CALLBACK fcn_)
Definition: ad.hpp:3752
tape_callback()
Definition: ad.hpp:3749
void free_userdata()
Definition: ad.hpp:3760
callback_object_t *& _userdata()
Definition: ad.hpp:3757
position_t position
Definition: ad.hpp:3747
position_t & _position()
Definition: ad.hpp:3765
Definition: ad.hpp:2909
const AD_TAPE_INT & tapesize() const
Definition: ad.hpp:2917
tape_options()
Definition: ad.hpp:2913
AD_TAPE_INT _tapesize
Definition: ad.hpp:2911
AD_TAPE_INT & tapesize()
Definition: ad.hpp:2914
TO_CREATE * create() const
Definition: ad.hpp:616
reference_constructor_wrapper(void *v)
Definition: ad.hpp:612
Definition: ad.hpp:600
const TYPE & T
Definition: ad.hpp:601
TO_CREATE * create() const
Definition: ad.hpp:605
reference_constructor_wrapper(const TYPE &T_)
Definition: ad.hpp:603
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::operations::ad_sinh< AD_TAPE_REAL > > sinh(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x1)
Definition: ad.hpp:957
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP >, ad::operations::ad_asinh< AD_TAPE_REAL > > asinh(const ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &x1)
Definition: ad.hpp:1086
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP >, ad::operations::ad_expm1< AD_TAPE_REAL > > expm1(const ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &x1)
Definition: ad.hpp:1075
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::operations::ad_sin< AD_TAPE_REAL > > sin(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x1)
Definition: ad.hpp:913
static std::istream & operator>>(std::istream &in, const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x)
Definition: ad.hpp:2435
ad::internal::binary_intermediate_aa< AD_TAPE_REAL, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::operations::ad_hypot_aa< AD_TAPE_REAL > > hypot(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x1, const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x2)
Definition: ad.hpp:1701
static bool isinf(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x)
Definition: ad.hpp:2447
static bool operator!=(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x1, const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x2)
Definition: ad.hpp:1899
static bool isfinite(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x)
Definition: ad.hpp:2453
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::operations::ad_asin< AD_TAPE_REAL > > asin(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x1)
Definition: ad.hpp:968
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP >, ad::operations::ad_sinh< AD_TAPE_REAL > > sinh(const ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &x1)
Definition: ad.hpp:965
static bool isnan(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x)
Definition: ad.hpp:2445
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::operations::ad_sqrt< AD_TAPE_REAL > > sqrt(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x1)
Definition: ad.hpp:1023
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::operations::ad_log1p< AD_TAPE_REAL > > log1p(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x1)
Definition: ad.hpp:1111
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::operations::ad_erf< AD_TAPE_REAL > > erf(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x1)
Definition: ad.hpp:1045
ad::internal::binary_intermediate_aa< AD_TAPE_REAL, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::operations::ad_div_aa< AD_TAPE_REAL > > operator/(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x1, const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x2)
Definition: ad.hpp:1428
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::operations::ad_acosh< AD_TAPE_REAL > > acosh(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x1)
Definition: ad.hpp:1089
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::operations::ad_tan< AD_TAPE_REAL > > tan(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x1)
Definition: ad.hpp:935
ad::internal::binary_intermediate_aa< AD_TAPE_REAL, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::operations::ad_mul_aa< AD_TAPE_REAL > > operator*(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x1, const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x2)
Definition: ad.hpp:1337
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP >, ad::operations::ad_atanh< AD_TAPE_REAL > > atanh(const ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &x1)
Definition: ad.hpp:1108
static std::ostream & operator<<(std::ostream &out, const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x)
Definition: ad.hpp:2520
static bool isnan(const ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &x)
Definition: ad.hpp:2509
static double floor(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x)
Definition: ad.hpp:2451
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::operations::ad_atanh< AD_TAPE_REAL > > atanh(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x1)
Definition: ad.hpp:1100
static min_max_return_type< ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > >::type min(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &a, const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &b)
Definition: ad.hpp:2599
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP >, ad::operations::ad_atan< AD_TAPE_REAL > > atan(const ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &x1)
Definition: ad.hpp:1009
std::enable_if<!std::is_same< typename ad::internal::binary_intermediate_pa< AD_TAPE_REAL, A1_T2, A1_OP >::VALUE_TYPE, typename ad::internal::binary_intermediate_pa< AD_TAPE_REAL, A1_T2, A1_OP >::PASSIVE_VALUE_TYPE >::value, ad::internal::binary_intermediate_pa< AD_TAPE_REAL, ad::internal::binary_intermediate_pa< AD_TAPE_REAL, A1_T2, A1_OP >, ad::operations::ad_atan2_pa< AD_TAPE_REAL > > >::type atan2(const typename ad::internal::binary_intermediate_pa< AD_TAPE_REAL, A1_T2, A1_OP >::PASSIVE_VALUE_TYPE &x1, const ad::internal::binary_intermediate_pa< AD_TAPE_REAL, A1_T2, A1_OP > &x2)
Definition: ad.hpp:1607
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::operations::ad_fabs< AD_TAPE_REAL > > abs(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x1)
Definition: ad.hpp:1144
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP >, ad::operations::ad_log1p< AD_TAPE_REAL > > log1p(const ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &x1)
Definition: ad.hpp:1119
ad::internal::binary_intermediate_aa< AD_TAPE_REAL, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::operations::ad_pow_aa< AD_TAPE_REAL > > pow(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x1, const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x2)
Definition: ad.hpp:1610
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP >, ad::operations::ad_acosh< AD_TAPE_REAL > > acosh(const ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &x1)
Definition: ad.hpp:1097
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP >, ad::operations::ad_tanh< AD_TAPE_REAL > > tanh(const ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &x1)
Definition: ad.hpp:1020
static bool isfinite(const ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &x)
Definition: ad.hpp:2517
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::operations::ad_acos< AD_TAPE_REAL > > acos(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x1)
Definition: ad.hpp:979
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::operations::ad_atan< AD_TAPE_REAL > > atan(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x1)
Definition: ad.hpp:1001
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP >, ad::operations::ad_log10< AD_TAPE_REAL > > log10(const ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &x1)
Definition: ad.hpp:1130
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::operations::ad_expm1< AD_TAPE_REAL > > expm1(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x1)
Definition: ad.hpp:1067
static min_max_return_type< ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > >::type max(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &a, const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &b)
Definition: ad.hpp:2596
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::operations::ad_minus< AD_TAPE_REAL > > operator-(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x1)
Definition: ad.hpp:891
static bool operator==(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x1, const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x2)
Definition: ad.hpp:1793
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP >, ad::operations::ad_cos< AD_TAPE_REAL > > cos(const ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &x1)
Definition: ad.hpp:932
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::operations::ad_cos< AD_TAPE_REAL > > cos(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x1)
Definition: ad.hpp:924
ad::internal::binary_intermediate_aa< AD_TAPE_REAL, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::operations::ad_atan2_aa< AD_TAPE_REAL > > atan2(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x1, const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x2)
Definition: ad.hpp:1519
static bool isinf(const ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &x)
Definition: ad.hpp:2511
std::enable_if<!std::is_same< typename ad::internal::binary_intermediate_pa< AD_TAPE_REAL, A1_T2, A1_OP >::VALUE_TYPE, typename ad::internal::binary_intermediate_pa< AD_TAPE_REAL, A1_T2, A1_OP >::PASSIVE_VALUE_TYPE >::value, ad::internal::binary_intermediate_pa< AD_TAPE_REAL, ad::internal::binary_intermediate_pa< AD_TAPE_REAL, A1_T2, A1_OP >, ad::operations::ad_pow_pa< AD_TAPE_REAL > > >::type pow(const typename ad::internal::binary_intermediate_pa< AD_TAPE_REAL, A1_T2, A1_OP >::PASSIVE_VALUE_TYPE &x1, const ad::internal::binary_intermediate_pa< AD_TAPE_REAL, A1_T2, A1_OP > &x2)
Definition: ad.hpp:1698
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP >, ad::operations::ad_erf< AD_TAPE_REAL > > erf(const ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &x1)
Definition: ad.hpp:1053
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP >, ad::operations::ad_exp< AD_TAPE_REAL > > exp(const ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &x1)
Definition: ad.hpp:998
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP >, ad::operations::ad_asin< AD_TAPE_REAL > > asin(const ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &x1)
Definition: ad.hpp:976
static bool operator>=(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x1, const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x2)
Definition: ad.hpp:2323
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::operations::ad_erfc< AD_TAPE_REAL > > erfc(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x1)
Definition: ad.hpp:1056
static bool operator>(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x1, const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x2)
Definition: ad.hpp:2217
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP >, ad::operations::ad_fabs< AD_TAPE_REAL > > fabs(const ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &x1)
Definition: ad.hpp:1141
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::operations::ad_plus< AD_TAPE_REAL > > operator+(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x1)
Definition: ad.hpp:902
static bool operator<=(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x1, const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x2)
Definition: ad.hpp:2111
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP >, ad::operations::ad_log< AD_TAPE_REAL > > log(const ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &x1)
Definition: ad.hpp:1042
static double ceil(const ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &x)
Definition: ad.hpp:2513
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP >, ad::operations::ad_sin< AD_TAPE_REAL > > sin(const ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &x1)
Definition: ad.hpp:921
static double ceil(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x)
Definition: ad.hpp:2449
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP >, ad::operations::ad_cosh< AD_TAPE_REAL > > cosh(const ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &x1)
Definition: ad.hpp:954
static double floor(const ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &x)
Definition: ad.hpp:2515
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP >, ad::operations::ad_tan< AD_TAPE_REAL > > tan(const ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &x1)
Definition: ad.hpp:943
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::operations::ad_log< AD_TAPE_REAL > > log(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x1)
Definition: ad.hpp:1034
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::operations::ad_tanh< AD_TAPE_REAL > > tanh(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x1)
Definition: ad.hpp:1012
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::operations::ad_asinh< AD_TAPE_REAL > > asinh(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x1)
Definition: ad.hpp:1078
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP >, ad::operations::ad_sqrt< AD_TAPE_REAL > > sqrt(const ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &x1)
Definition: ad.hpp:1031
static void reset_variable(ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x)
Definition: ad.hpp:2429
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP >, ad::operations::ad_acos< AD_TAPE_REAL > > acos(const ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &x1)
Definition: ad.hpp:987
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::operations::ad_fabs< AD_TAPE_REAL > > fabs(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x1)
Definition: ad.hpp:1133
std::enable_if<!std::is_same< typename ad::internal::binary_intermediate_pa< AD_TAPE_REAL, A1_T2, A1_OP >::VALUE_TYPE, typename ad::internal::binary_intermediate_pa< AD_TAPE_REAL, A1_T2, A1_OP >::PASSIVE_VALUE_TYPE >::value, ad::internal::binary_intermediate_pa< AD_TAPE_REAL, ad::internal::binary_intermediate_pa< AD_TAPE_REAL, A1_T2, A1_OP >, ad::operations::ad_hypot_pa< AD_TAPE_REAL > > >::type hypot(const typename ad::internal::binary_intermediate_pa< AD_TAPE_REAL, A1_T2, A1_OP >::PASSIVE_VALUE_TYPE &x1, const ad::internal::binary_intermediate_pa< AD_TAPE_REAL, A1_T2, A1_OP > &x2)
Definition: ad.hpp:1789
static bool operator<(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x1, const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x2)
Definition: ad.hpp:2005
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::operations::ad_log10< AD_TAPE_REAL > > log10(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x1)
Definition: ad.hpp:1122
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::operations::ad_exp< AD_TAPE_REAL > > exp(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x1)
Definition: ad.hpp:990
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >, ad::operations::ad_cosh< AD_TAPE_REAL > > cosh(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x1)
Definition: ad.hpp:946
ad::internal::unary_intermediate< AD_TAPE_REAL, ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP >, ad::operations::ad_erfc< AD_TAPE_REAL > > erfc(const ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &x1)
Definition: ad.hpp:1064
Definition: ad.h:31
trait_tape_index< T >::RETURN_TYPE tape_index(T &x)
Definition: ad.hpp:3487
static size_t size_of(const tape_t *tape)
Definition: ad.hpp:4155
trait_derivative< T >::RETURN_TYPE derivative(T &x)
Definition: ad.hpp:3412
trait_passive_value< T >::RETURN_TYPE & passive_value(T &x)
Definition: ad.hpp:3377
trait_value< T >::RETURN_TYPE & value(T &x)
Definition: ad.hpp:3308
ApplyResultT< F, T... > eval(F f, const IOResult< T > &... rs)
Evaluates a function f using values of the given IOResults as arguments, assumes all IOResults are su...
Definition: io.h:448
int size(Comm comm)
Return the size of the given communicator.
Definition: miompi.cpp:75
requires details::IsElementReference< M > RowMajorIterator< M, false > end(M &m)
create a non-const end iterator for the matrix m.
Definition: eigen_util.h:449
auto i
Definition: io.h:809
constexpr std::tuple_element< I, std::tuple< Index< CategoryTags >... > >::type & get(Index< CategoryTags... > &i) noexcept
Retrieves the Index (by reference) at the Ith position of a MultiIndex.
Definition: index.h:294
Definition: ad.hpp:103
static const bool value
Definition: ad.hpp:103
Definition: ad.hpp:593
T type
Definition: ad.hpp:594
Else RET
Definition: ad.hpp:2568
Definition: ad.hpp:2563
Then RET
Definition: ad.hpp:2564
ad::internal::active_type< typename ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >::VALUE_TYPE, typename ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >::DATA_TYPE > RET
Definition: ad.hpp:2575
ad::internal::active_type< typename ad::internal::binary_intermediate_aa< AD_TAPE_REAL, A1_T1, A1_T2, A1_OP >::VALUE_TYPE, typename ad::internal::binary_intermediate_aa< AD_TAPE_REAL, A1_T1, A1_T2, A1_OP >::DATA_TYPE > RET
Definition: ad.hpp:2581
ad::internal::active_type< typename ad::internal::binary_intermediate_ap< AD_TAPE_REAL, A1_T1, A1_OP >::VALUE_TYPE, typename ad::internal::binary_intermediate_ap< AD_TAPE_REAL, A1_T1, A1_OP >::DATA_TYPE > RET
Definition: ad.hpp:2584
ad::internal::active_type< typename ad::internal::binary_intermediate_pa< AD_TAPE_REAL, A1_T2, A1_OP >::VALUE_TYPE, typename ad::internal::binary_intermediate_pa< AD_TAPE_REAL, A1_T2, A1_OP >::DATA_TYPE > RET
Definition: ad.hpp:2587
ad::internal::active_type< typename ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP >::VALUE_TYPE, typename ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP >::DATA_TYPE > RET
Definition: ad.hpp:2578
Definition: ad.hpp:2571
T RET
Definition: ad.hpp:2572
Definition: ad.hpp:692
active_type & operator/=(const active_type< AD_TAPE_REAL, DATA_HANDLER_TMP > &x)
Definition: ad.hpp:848
active_type(const PASSIVE_VALUE_TYPE &val)
Definition: ad.hpp:730
active_type & operator+=(const active_type< AD_TAPE_REAL, DATA_HANDLER_TMP > &x)
Definition: ad.hpp:791
active_type(const ad::internal::binary_intermediate_aa< AD_TAPE_REAL, A1_T1, A1_T2, A1_OP > &x)
Definition: ad.hpp:752
active_type & operator++()
Definition: ad.hpp:867
void build_from(const ad::internal::binary_intermediate_aa< AD_TAPE_REAL, A1_T1, A1_T2, A1_OP > &x)
Definition: ad.hpp:748
void build_from(const ad::internal::binary_intermediate_pa< AD_TAPE_REAL, A1_T2, A1_OP > &x)
Definition: ad.hpp:770
void build_from(const ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &x)
Definition: ad.hpp:781
passive_value_type_of< AD_TAPE_REAL >::TYPE PASSIVE_VALUE_TYPE
Definition: ad.hpp:699
active_type(const ad::internal::binary_intermediate_ap< AD_TAPE_REAL, A1_T1, A1_OP > &x)
Definition: ad.hpp:763
DATA_HANDLER DATA_TYPE
Definition: ad.hpp:698
void build_from(const ad::internal::binary_intermediate_ap< AD_TAPE_REAL, A1_T1, A1_OP > &x)
Definition: ad.hpp:759
AD_TAPE_REAL & _value()
Definition: ad.hpp:703
active_type & operator=(const TYPE &val)
Definition: ad.hpp:718
void _clear()
Definition: ad.hpp:712
DATA_HANDLER & _data()
Definition: ad.hpp:709
DATA_HANDLER _data_
Definition: ad.hpp:695
active_type(const ad::internal::binary_intermediate_pa< AD_TAPE_REAL, A1_T2, A1_OP > &x)
Definition: ad.hpp:774
active_type(const ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &x)
Definition: ad.hpp:785
active_type(const active_type &)=default
active_type()
Definition: ad.hpp:727
active_type & operator*=(const active_type< AD_TAPE_REAL, DATA_HANDLER_TMP > &x)
Definition: ad.hpp:829
const DATA_HANDLER & _data() const
Definition: ad.hpp:706
const AD_TAPE_REAL & _value() const
Definition: ad.hpp:700
active_type(const active_type< AD_TAPE_REAL_TMP, DATA_HANDLER_TMP > &val)
Definition: ad.hpp:729
AD_TAPE_REAL VALUE_TYPE
Definition: ad.hpp:697
active_type(const TYPE &val)
Definition: ad.hpp:724
active_type & operator--()
Definition: ad.hpp:871
active_type & operator-=(const active_type< AD_TAPE_REAL, DATA_HANDLER_TMP > &x)
Definition: ad.hpp:810
AD_TAPE_REAL _value_
Definition: ad.hpp:694
const AD_TAPE_REAL pval2() const
Definition: ad.hpp:651
AD_TAPE_REAL VALUE_TYPE
Definition: ad.hpp:641
AD_TAPE_REAL _value_
Definition: ad.hpp:638
AD_ARG1::DATA_TYPE DATA_TYPE
Definition: ad.hpp:642
binary_intermediate_aa(const AD_ARG1 &arg1, const AD_ARG2 &arg2)
Definition: ad.hpp:643
const AD_TAPE_REAL & _value() const
Definition: ad.hpp:654
const AD_TAPE_REAL pval1() const
Definition: ad.hpp:648
const AD_ARG2 & _arg2
Definition: ad.hpp:640
const AD_ARG1 & _arg1
Definition: ad.hpp:639
const AD_TAPE_REAL _value_
Definition: ad.hpp:659
AD_TAPE_REAL VALUE_TYPE
Definition: ad.hpp:662
AD_ARG1::DATA_TYPE DATA_TYPE
Definition: ad.hpp:663
const AD_ARG1 & _arg1
Definition: ad.hpp:660
binary_intermediate_ap(const AD_ARG1 &arg1, const AD_TAPE_REAL &arg2)
Definition: ad.hpp:664
const AD_TAPE_REAL & _value() const
Definition: ad.hpp:666
const AD_TAPE_REAL _arg2
Definition: ad.hpp:661
const AD_TAPE_REAL pval1() const
Definition: ad.hpp:669
const AD_TAPE_REAL & _value() const
Definition: ad.hpp:681
AD_ARG2::DATA_TYPE DATA_TYPE
Definition: ad.hpp:678
const AD_TAPE_REAL _value_
Definition: ad.hpp:674
binary_intermediate_pa(const AD_TAPE_REAL &arg1, const AD_ARG2 &arg2)
Definition: ad.hpp:679
const AD_TAPE_REAL pval2() const
Definition: ad.hpp:684
const AD_TAPE_REAL _arg1
Definition: ad.hpp:675
AD_TAPE_REAL VALUE_TYPE
Definition: ad.hpp:677
const AD_ARG2 & _arg2
Definition: ad.hpp:676
Definition: ad.hpp:3500
AD_TAPE_REAL pval
Definition: ad.hpp:3502
AD_TAPE_INT arg
Definition: ad.hpp:3501
void interpret(const ad::internal::binary_intermediate_aa< AD_TAPE_REAL, A1_T1, A1_T2, A1_OP > &x, const AD_TAPE_REAL &pval)
Definition: ad.hpp:4014
void interpret(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x, const AD_TAPE_REAL &pval)
Definition: ad.hpp:4006
void interpret(const ad::internal::binary_intermediate_ap< AD_TAPE_REAL, A1_T1, A1_OP > &x, const AD_TAPE_REAL &pval)
Definition: ad.hpp:4023
tapehandler(TAPE_ENTRY *ins_ptr, const int edgecount, AD_INTERMEDIATE vneu)
Definition: ad.hpp:4001
void interpret(const ad::internal::binary_intermediate_pa< AD_TAPE_REAL, A1_T2, A1_OP > &x, const AD_TAPE_REAL &pval)
Definition: ad.hpp:4027
void interpret(const ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &x, const AD_TAPE_REAL &pval)
Definition: ad.hpp:4019
TAPE_ENTRY * _ins_ptr
Definition: ad.hpp:3999
static int _get_edge_count(const ad::internal::binary_intermediate_ap< AD_TAPE_REAL, A1_T1, A1_OP > &x)
Definition: ad.hpp:3991
static int _get_edge_count(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x)
Definition: ad.hpp:3979
static int _get_edge_count(const ad::internal::binary_intermediate_aa< AD_TAPE_REAL, A1_T1, A1_T2, A1_OP > &x)
Definition: ad.hpp:3983
static int _get_edge_count(const ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &x)
Definition: ad.hpp:3987
static int _get_edge_count(const ad::internal::binary_intermediate_pa< AD_TAPE_REAL, A1_T2, A1_OP > &x)
Definition: ad.hpp:3995
const AD_TAPE_INT & _stackcounter() const
Definition: ad.hpp:3512
const AD_TAPE_INT & _progvarcounter() const
Definition: ad.hpp:3515
bool operator<(const position_t &other) const
Definition: ad.hpp:3524
AD_TAPE_INT progvarcounter
Definition: ad.hpp:3508
bool operator==(const position_t &other) const
Definition: ad.hpp:3518
position_t(const AD_TAPE_INT nstackcounter, const AD_TAPE_INT nprogvarcounter)
Definition: ad.hpp:3509
position_t()
Definition: ad.hpp:3511
AD_TAPE_INT stackcounter
Definition: ad.hpp:3507
bool operator>(const position_t &other) const
Definition: ad.hpp:3521
void register_variable(AD_TAPE_INT new_tape_index, AD_TAPE_CLASS *tape)
Definition: ad.hpp:4064
void _set_tape(AD_TAPE_CLASS *T)
Definition: ad.hpp:4092
AD_TAPE_CLASS DATA_TAPE_TYPE
Definition: ad.hpp:4034
int _edgecount() const
Definition: ad.hpp:4061
bool _is_registered() const
Definition: ad.hpp:4052
AD_TAPE_INT & _tape_index()
Definition: ad.hpp:4055
void clear()
Definition: ad.hpp:4040
AD_ADJOINT_REAL & _adjoint() const
Definition: ad.hpp:4049
single_tape_data()
Definition: ad.hpp:4039
AD_ADJOINT_REAL & _derivative()
Definition: ad.hpp:4046
const AD_TAPE_INT & _tape_index() const
Definition: ad.hpp:4058
const AD_TAPE_INT & TAPE_INDEX_TYPE
Definition: ad.hpp:4035
AD_TAPE_INT _tape_index_
Definition: ad.hpp:4037
AD_ADJOINT_REAL DERIVATIVE_T
Definition: ad.hpp:4036
const AD_ADJOINT_REAL & _derivative() const
Definition: ad.hpp:4043
static void handle(const AD_INTERMEDIATE &vneu, AD_ACTIVE_TYPE &target)
Definition: ad.hpp:4069
static AD_TAPE_CLASS * _tape()
Definition: ad.hpp:4089
Definition: ad.hpp:3498
ad::internal::blob_tape< AD_TAPE_REAL, AD_ADJOINT_REAL > AD_TAPE_CLASS
Definition: ad.hpp:3685
void interpret_adjoint_from(const position_t &from)
Definition: ad.hpp:3927
void register_output_variable(std::vector< ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > > &x)
Definition: ad.hpp:3904
ext_fcn_data_type * create_callback_object(const FCN_PARAMETERS &parameters)
Definition: ad.hpp:3775
void switch_to_passive()
Definition: ad.hpp:3859
void register_variable(std::vector< ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > > &x)
Definition: ad.hpp:3877
size_t get_tape_memory_size() const
Definition: ad.hpp:3651
void reset()
Definition: ad.hpp:3912
void _register_variables_internal(AD_ACTIVE *actives, const typename AD_ACTIVE::VALUE_TYPE *values, int *outs, const int n)
Definition: ad.hpp:3616
AD_ADJOINT_REAL * _adjoints
Definition: ad.hpp:3531
void insert_callback(FCN_CALLBACK callback_handler, ext_fcn_data_type *D)
Definition: ad.hpp:3791
void zero_adjoints_from(const position_t &from)
Definition: ad.hpp:3969
TAPE_ENTRY * _stack
Definition: ad.hpp:3532
void interpret_adjoint_and_zero_adjoints_to(const position_t &to)
Definition: ad.hpp:3949
bool _isactive
Definition: ad.hpp:3536
static void remove(blob_tape *&tape)
Definition: ad.hpp:3680
void _reset_tape_callbacks_to(const position_t &to)
Definition: ad.hpp:3802
void reset_to(const position_t &to)
Definition: ad.hpp:3908
void zero_adjoints_to(const position_t &to)
Definition: ad.hpp:3966
void _interpret_adjoint_internal_plain(const position_t &from, const position_t &to, const interpretation_settings &settings)
Definition: ad.hpp:3597
AD_TAPE_INT _stack_size
Definition: ad.hpp:3533
AD_ADJOINT_REAL & _adjoint(const size_t tape_index)
Definition: ad.hpp:3642
void interpret_adjoint_to(const position_t &to)
Definition: ad.hpp:3920
int _vecidx
Definition: ad.hpp:3537
TAPE_ENTRY * _get_insert_ptr_range(const int num_entries2fill, AD_TAPE_INT &new_tape_index)
Definition: ad.hpp:3559
void zero_adjoints()
Definition: ad.hpp:3962
TAPE_ENTRY * _topOfStack
Definition: ad.hpp:3529
void register_variable(ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x, const typename ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >::VALUE_TYPE &v)
Definition: ad.hpp:3872
static blob_tape * create(AD_TAPE_INT size, AD_TAPE_INT progvarcounter=0)
Definition: ad.hpp:3663
bool is_active()
Definition: ad.hpp:3853
double get_allocated_tape_memory_size() const
Definition: ad.hpp:3654
ad::helper::callback_object_base< AD_TAPE_CLASS > callback_object_t
Definition: ad.hpp:3692
void register_output_variable(ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x)
Definition: ad.hpp:3894
AD_TAPE_INT _progvarcounter
Definition: ad.hpp:3530
void _zero_adjoints_internal(const position_t &from, const position_t &to)
Definition: ad.hpp:3603
void interpret_adjoint_and_zero_adjoints_from_to(const position_t &from, const position_t &to)
Definition: ad.hpp:3956
void zero_adjoints_from_to(const position_t &from, const position_t &to)
Definition: ad.hpp:3973
void interpret_adjoint()
Definition: ad.hpp:3915
AD_TAPE_INT _adjoint_size
Definition: ad.hpp:3534
AD_TAPE_REAL & _adjointEx(const size_t tape_index)
Definition: ad.hpp:3636
void _finish_current_insert_ptr(TAPE_ENTRY *const end)
Definition: ad.hpp:3548
void register_output_variable(ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > *x, const size_t n)
Definition: ad.hpp:3898
void register_variable(ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > *x, const size_t n)
Definition: ad.hpp:3888
void _interpret_adjoint_internal(const position_t &from, const position_t &to, const interpretation_settings &settings)
Definition: ad.hpp:3814
blob_tape()
Definition: ad.hpp:3545
static blob_tape * create(tape_options options=tape_options())
Definition: ad.hpp:3660
void interpret_adjoint_and_reset_to(const position_t &to)
Definition: ad.hpp:3940
~blob_tape()
Definition: ad.hpp:3539
void register_variable(ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x)
Definition: ad.hpp:3863
void switch_to_active()
Definition: ad.hpp:3856
double get_checkpoint_memory_size()
Definition: ad.hpp:3645
bool _isdead
Definition: ad.hpp:3535
void _interpret_chunk(TAPE_ENTRY *start, TAPE_ENTRY *end, AD_TAPE_INT &progvaridx, const interpretation_settings &settings)
Definition: ad.hpp:3570
void register_variable(ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > *x, const int n, const typename ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >::VALUE_TYPE *const v)
Definition: ad.hpp:3882
position_t get_position() const
Definition: ad.hpp:3633
size_t _get_tape_memory() const
Definition: ad.hpp:3657
void interpret_adjoint_from_to(const position_t &from, const position_t &to)
Definition: ad.hpp:3933
void _reset_to_internal(const position_t &to)
Definition: ad.hpp:3609
TAPE_ENTRY * _get_insert_ptr(const int num_entries2fill, AD_TAPE_INT &new_tape_index)
Definition: ad.hpp:3551
std::vector< tape_callback > tape_callbacks
Definition: ad.hpp:3773
ext_fcn_data_type * create_callback_object()
Definition: ad.hpp:3786
Definition: ad.hpp:2544
static const bool RET
Definition: ad.hpp:2545
Definition: ad.hpp:2590
IF< is_not_ad_type< AD_ARG1 >::RET, AD_ARG1, typename active_type_of< AD_ARG1 >::RET >::RET tmp_type
Definition: ad.hpp:2591
IF< is_not_ad_type< AD_ARG2 >::RET, AD_ARG2, typename active_type_of< AD_ARG2 >::RET >::RET tmp_type2
Definition: ad.hpp:2592
IF< is_not_ad_type< ret_type1 >::RET, AD_ARG1, ret_type1 >::RET type
Definition: ad.hpp:2594
IF< is_not_ad_type< AD_ARG1 >::RET, tmp_type2, tmp_type >::RET ret_type1
Definition: ad.hpp:2593
passive_value_type_of< AD_TAPE_REAL >::TYPE TYPE
Definition: ad.hpp:888
T TYPE
Definition: ad.hpp:690
Definition: ad.hpp:2850
ts_data & operator=(const ts_data &b)
Definition: ad.hpp:2854
AD_TAPE_INT _tape_index() const
Definition: ad.hpp:2901
static AD_TAPE_REAL get_tlm(const ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &x, const AD_TAPE_REAL &pval)
Definition: ad.hpp:2885
static void handle(const AD_INTERMEDIATE &vneu, AD_ACTIVE_TYPE &target)
Definition: ad.hpp:2872
AD_TAPE_REAL & _derivative()
Definition: ad.hpp:2866
void DATA_TAPE_TYPE
Definition: ad.hpp:2896
static AD_TAPE_REAL get_tlm(const ad::internal::binary_intermediate_aa< AD_TAPE_REAL, A1_T1, A1_T2, A1_OP > &x, const AD_TAPE_REAL &pval)
Definition: ad.hpp:2881
static AD_TAPE_REAL get_tlm(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x, const AD_TAPE_REAL &pval)
Definition: ad.hpp:2877
void clear()
Definition: ad.hpp:2858
static AD_TAPE_REAL get_tlm(const ad::internal::binary_intermediate_pa< AD_TAPE_REAL, A1_T2, A1_OP > &x, const AD_TAPE_REAL &pval)
Definition: ad.hpp:2893
AD_TAPE_INT TAPE_INDEX_TYPE
Definition: ad.hpp:2897
AD_TAPE_REAL tlm
Definition: ad.hpp:2852
AD_TAPE_REAL DERIVATIVE_T
Definition: ad.hpp:2851
void * _tape() const
Definition: ad.hpp:2898
const AD_TAPE_REAL & _derivative() const
Definition: ad.hpp:2861
ts_data()
Definition: ad.hpp:2853
static AD_TAPE_REAL get_tlm(const ad::internal::binary_intermediate_ap< AD_TAPE_REAL, A1_T1, A1_OP > &x, const AD_TAPE_REAL &pval)
Definition: ad.hpp:2889
Definition: ad.hpp:623
unary_intermediate(const AD_ARG &arg)
Definition: ad.hpp:628
const AD_TAPE_REAL & _value() const
Definition: ad.hpp:630
const AD_TAPE_REAL _value_
Definition: ad.hpp:624
AD_TAPE_REAL VALUE_TYPE
Definition: ad.hpp:626
const AD_TAPE_REAL pval() const
Definition: ad.hpp:633
const AD_ARG & _arg
Definition: ad.hpp:625
AD_ARG::DATA_TYPE DATA_TYPE
Definition: ad.hpp:627
Definition: ad.hpp:4115
Definition: ad.hpp:313
static const AD_TAPE_REAL eval(const T &arg)
Definition: ad.hpp:314
static const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x)
Definition: ad.hpp:316
Definition: ad.hpp:394
static const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x)
Definition: ad.hpp:397
static const AD_TAPE_REAL eval(const T &arg)
Definition: ad.hpp:395
Definition: ad.hpp:118
static const AD_TAPE_REAL eval(const T1 &arg1, const T2 &arg2)
Definition: ad.hpp:119
static const AD_TAPE_REAL calc_partial2(const AD_TAPE_REAL &_value, const T1 &arg1, const T2 &arg2)
Definition: ad.hpp:126
static const AD_TAPE_REAL calc_partial1(const AD_TAPE_REAL &_value, const T1 &arg1, const T2 &arg2)
Definition: ad.hpp:121
Definition: ad.hpp:178
static const AD_TAPE_REAL calc_partial1(const AD_TAPE_REAL &_value, const T1 &arg1, const AD_TAPE_REAL &arg2)
Definition: ad.hpp:181
static const AD_TAPE_REAL eval(const T1 &arg1, const AD_TAPE_REAL &arg2)
Definition: ad.hpp:179
Definition: ad.hpp:188
static const AD_TAPE_REAL calc_partial2(const AD_TAPE_REAL &_value, const AD_TAPE_REAL &arg1, const T2 &arg2)
Definition: ad.hpp:191
static const AD_TAPE_REAL eval(const AD_TAPE_REAL &arg1, const T2 &arg2)
Definition: ad.hpp:189
Definition: ad.hpp:304
static const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x)
Definition: ad.hpp:307
static const AD_TAPE_REAL eval(const T &arg)
Definition: ad.hpp:305
Definition: ad.hpp:385
static const AD_TAPE_REAL eval(const T &arg)
Definition: ad.hpp:386
static const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x)
Definition: ad.hpp:388
Definition: ad.hpp:469
static const AD_TAPE_REAL calc_partial2(const AD_TAPE_REAL _value, const T1 &arg1, const T2 &arg2)
Definition: ad.hpp:479
static const AD_TAPE_REAL calc_partial1(const AD_TAPE_REAL _value, const T1 &arg1, const T2 &arg2)
Definition: ad.hpp:474
static const AD_TAPE_REAL eval(const T1 &arg1, const T2 &arg2)
Definition: ad.hpp:470
Definition: ad.hpp:486
static const AD_TAPE_REAL eval(const T &arg1, const AD_TAPE_REAL &arg2)
Definition: ad.hpp:487
static const AD_TAPE_REAL calc_partial1(const AD_TAPE_REAL _value, const T &arg1, const AD_TAPE_REAL &arg2)
Definition: ad.hpp:491
Definition: ad.hpp:498
static const AD_TAPE_REAL calc_partial2(const AD_TAPE_REAL _value, const AD_TAPE_REAL &arg1, const T &arg2)
Definition: ad.hpp:503
static const AD_TAPE_REAL eval(const AD_TAPE_REAL &arg1, const T &arg2)
Definition: ad.hpp:499
Definition: ad.hpp:331
static const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x)
Definition: ad.hpp:334
static const AD_TAPE_REAL eval(const T &arg)
Definition: ad.hpp:332
Definition: ad.hpp:412
static const AD_TAPE_REAL eval(const T &arg)
Definition: ad.hpp:413
static const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x)
Definition: ad.hpp:415
Definition: ad.hpp:268
static const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x)
Definition: ad.hpp:271
static const AD_TAPE_REAL eval(const T &arg)
Definition: ad.hpp:269
Definition: ad.hpp:286
static const AD_TAPE_REAL eval(const T &arg)
Definition: ad.hpp:287
static const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x)
Definition: ad.hpp:289
Definition: ad.hpp:163
static const AD_TAPE_REAL calc_partial2(const AD_TAPE_REAL &_value, const T1 &arg1, const T2 &arg2)
Definition: ad.hpp:171
static const AD_TAPE_REAL calc_partial1(const AD_TAPE_REAL &_value, const T1 &arg1, const T2 &arg2)
Definition: ad.hpp:166
static const AD_TAPE_REAL eval(const T1 &arg1, const T2 &arg2)
Definition: ad.hpp:164
Definition: ad.hpp:238
static const AD_TAPE_REAL calc_partial1(const AD_TAPE_REAL &_value, const T1 &arg1, const AD_TAPE_REAL &arg2)
Definition: ad.hpp:241
static const AD_TAPE_REAL eval(const T1 &arg1, const AD_TAPE_REAL &arg2)
Definition: ad.hpp:239
Definition: ad.hpp:248
static const AD_TAPE_REAL eval(const AD_TAPE_REAL &arg1, const T2 &arg2)
Definition: ad.hpp:249
static const AD_TAPE_REAL calc_partial2(const AD_TAPE_REAL &_value, const AD_TAPE_REAL &arg1, const T2 &arg2)
Definition: ad.hpp:251
Definition: ad.hpp:367
static const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x)
Definition: ad.hpp:370
static const AD_TAPE_REAL eval(const T &arg)
Definition: ad.hpp:368
Definition: ad.hpp:376
static const AD_TAPE_REAL eval(const T &arg)
Definition: ad.hpp:377
static const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x)
Definition: ad.hpp:379
Definition: ad.hpp:322
static const AD_TAPE_REAL eval(const T &arg)
Definition: ad.hpp:323
static const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x)
Definition: ad.hpp:325
Definition: ad.hpp:403
static const AD_TAPE_REAL eval(const T &arg)
Definition: ad.hpp:404
static const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x)
Definition: ad.hpp:406
Definition: ad.hpp:459
static const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &arg1)
Definition: ad.hpp:463
static const AD_TAPE_REAL eval(const T &arg1)
Definition: ad.hpp:460
Definition: ad.hpp:547
static const AD_TAPE_REAL calc_partial1(const AD_TAPE_REAL _value, const T1 &arg1, const T2 &arg2)
Definition: ad.hpp:552
static const AD_TAPE_REAL calc_partial2(const AD_TAPE_REAL _value, const T1 &arg1, const T2 &arg2)
Definition: ad.hpp:557
static const AD_TAPE_REAL eval(const T1 &arg1, const T2 &arg2)
Definition: ad.hpp:548
Definition: ad.hpp:564
static const AD_TAPE_REAL calc_partial1(const AD_TAPE_REAL _value, const T &arg1, const AD_TAPE_REAL &arg2)
Definition: ad.hpp:569
static const AD_TAPE_REAL eval(const T &arg1, const AD_TAPE_REAL &arg2)
Definition: ad.hpp:565
Definition: ad.hpp:576
static const AD_TAPE_REAL eval(const AD_TAPE_REAL &arg1, const T &arg2)
Definition: ad.hpp:577
static const AD_TAPE_REAL calc_partial2(const AD_TAPE_REAL _value, const AD_TAPE_REAL &arg1, const T &arg2)
Definition: ad.hpp:581
Definition: ad.hpp:430
static const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x)
Definition: ad.hpp:433
static const AD_TAPE_REAL eval(const T &arg)
Definition: ad.hpp:431
Definition: ad.hpp:421
static const AD_TAPE_REAL eval(const T &arg)
Definition: ad.hpp:422
static const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x)
Definition: ad.hpp:424
Definition: ad.hpp:358
static const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x)
Definition: ad.hpp:361
static const AD_TAPE_REAL eval(const T &arg)
Definition: ad.hpp:359
Definition: ad.hpp:438
static const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &arg1)
Definition: ad.hpp:442
static const AD_TAPE_REAL eval(const T &arg1)
Definition: ad.hpp:439
Definition: ad.hpp:148
static const AD_TAPE_REAL calc_partial1(const AD_TAPE_REAL &_value, const T1 &arg1, const T2 &arg2)
Definition: ad.hpp:151
static const AD_TAPE_REAL calc_partial2(const AD_TAPE_REAL &_value, const T1 &arg1, const T2 &arg2)
Definition: ad.hpp:156
static const AD_TAPE_REAL eval(const T1 &arg1, const T2 &arg2)
Definition: ad.hpp:149
Definition: ad.hpp:218
static const AD_TAPE_REAL eval(const T1 &arg1, const AD_TAPE_REAL &arg2)
Definition: ad.hpp:219
static const AD_TAPE_REAL calc_partial1(const AD_TAPE_REAL &_value, const T1 &arg1, const AD_TAPE_REAL &arg2)
Definition: ad.hpp:221
Definition: ad.hpp:228
static const AD_TAPE_REAL calc_partial2(const AD_TAPE_REAL &_value, const AD_TAPE_REAL &arg1, const T2 &arg2)
Definition: ad.hpp:231
static const AD_TAPE_REAL eval(const AD_TAPE_REAL &arg1, const T2 &arg2)
Definition: ad.hpp:229
Definition: ad.hpp:448
static const AD_TAPE_REAL eval(const T &arg1)
Definition: ad.hpp:449
static const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &arg1)
Definition: ad.hpp:452
Definition: ad.hpp:511
static const AD_TAPE_REAL calc_partial2(const AD_TAPE_REAL _value, const T1 &arg1, const T2 &arg2)
Definition: ad.hpp:519
static const AD_TAPE_REAL calc_partial1(const AD_TAPE_REAL _value, const T1 &arg1, const T2 &arg2)
Definition: ad.hpp:515
static const AD_TAPE_REAL eval(const T1 &arg1, const T2 &arg2)
Definition: ad.hpp:512
Definition: ad.hpp:528
static const AD_TAPE_REAL eval(const T &arg1, const AD_TAPE_REAL &arg2)
Definition: ad.hpp:529
static const AD_TAPE_REAL calc_partial1(const AD_TAPE_REAL _value, const T &arg1, const AD_TAPE_REAL &arg2)
Definition: ad.hpp:532
Definition: ad.hpp:538
static const AD_TAPE_REAL eval(const AD_TAPE_REAL &arg1, const T &arg2)
Definition: ad.hpp:539
static const AD_TAPE_REAL calc_partial2(const AD_TAPE_REAL _value, const AD_TAPE_REAL &arg1, const T &arg2)
Definition: ad.hpp:542
Definition: ad.hpp:259
static const AD_TAPE_REAL eval(const T &arg)
Definition: ad.hpp:260
static const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x)
Definition: ad.hpp:262
Definition: ad.hpp:295
static const AD_TAPE_REAL eval(const T &arg)
Definition: ad.hpp:296
static const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x)
Definition: ad.hpp:298
Definition: ad.hpp:349
static const AD_TAPE_REAL eval(const T &arg)
Definition: ad.hpp:350
static const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x)
Definition: ad.hpp:352
Definition: ad.hpp:133
static const AD_TAPE_REAL eval(const T1 &arg1, const T2 &arg2)
Definition: ad.hpp:134
static const AD_TAPE_REAL calc_partial2(const AD_TAPE_REAL &_value, const T1 &arg1, const T2 &arg2)
Definition: ad.hpp:141
static const AD_TAPE_REAL calc_partial1(const AD_TAPE_REAL &_value, const T1 &arg1, const T2 &arg2)
Definition: ad.hpp:136
Definition: ad.hpp:198
static const AD_TAPE_REAL calc_partial1(const AD_TAPE_REAL &_value, const T1 &arg1, const AD_TAPE_REAL &arg2)
Definition: ad.hpp:201
static const AD_TAPE_REAL eval(const T1 &arg1, const AD_TAPE_REAL &arg2)
Definition: ad.hpp:199
Definition: ad.hpp:208
static const AD_TAPE_REAL calc_partial2(const AD_TAPE_REAL &_value, const AD_TAPE_REAL &arg1, const T2 &arg2)
Definition: ad.hpp:211
static const AD_TAPE_REAL eval(const AD_TAPE_REAL &arg1, const T2 &arg2)
Definition: ad.hpp:209
Definition: ad.hpp:277
static const AD_TAPE_REAL eval(const T &arg)
Definition: ad.hpp:278
static const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x)
Definition: ad.hpp:280
Definition: ad.hpp:340
static const AD_TAPE_REAL eval(const T &arg)
Definition: ad.hpp:341
static const AD_TAPE_REAL calc_partial(const AD_TAPE_REAL &_value, const T &x)
Definition: ad.hpp:343
ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >::DATA_TYPE::DERIVATIVE_T & RETURN_TYPE
Definition: ad.hpp:3392
static RETURN_TYPE value(ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &value)
Definition: ad.hpp:3393
ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >::DATA_TYPE::DERIVATIVE_T & RETURN_TYPE
Definition: ad.hpp:3398
static RETURN_TYPE value(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &value)
Definition: ad.hpp:3399
Definition: ad.hpp:3384
T RETURN_TYPE
Definition: ad.hpp:3385
static RETURN_TYPE value(const T &vvalue)
Definition: ad.hpp:3386
trait_passive_value< typename ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >::VALUE_TYPE >::RETURN_TYPE RETURN_TYPE
Definition: ad.hpp:3317
static RETURN_TYPE & value(ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x)
Definition: ad.hpp:3318
static RETURN_TYPE & value(ad::internal::binary_intermediate_aa< AD_TAPE_REAL, A1_T1, A1_T2, A1_OP > &x)
Definition: ad.hpp:3342
trait_passive_value< typename ad::internal::binary_intermediate_aa< AD_TAPE_REAL, A1_T1, A1_T2, A1_OP >::VALUE_TYPE >::RETURN_TYPE RETURN_TYPE
Definition: ad.hpp:3341
static RETURN_TYPE & value(ad::internal::binary_intermediate_ap< AD_TAPE_REAL, A1_T1, A1_OP > &x)
Definition: ad.hpp:3354
trait_passive_value< typename ad::internal::binary_intermediate_ap< AD_TAPE_REAL, A1_T1, A1_OP >::VALUE_TYPE >::RETURN_TYPE RETURN_TYPE
Definition: ad.hpp:3353
static RETURN_TYPE & value(ad::internal::binary_intermediate_pa< AD_TAPE_REAL, A1_T2, A1_OP > &x)
Definition: ad.hpp:3366
trait_passive_value< typename ad::internal::binary_intermediate_pa< AD_TAPE_REAL, A1_T2, A1_OP >::VALUE_TYPE >::RETURN_TYPE RETURN_TYPE
Definition: ad.hpp:3365
static RETURN_TYPE & value(ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &x)
Definition: ad.hpp:3330
trait_passive_value< typename ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP >::VALUE_TYPE >::RETURN_TYPE RETURN_TYPE
Definition: ad.hpp:3329
const trait_passive_value< typename ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >::VALUE_TYPE >::RETURN_TYPE RETURN_TYPE
Definition: ad.hpp:3323
static RETURN_TYPE & value(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &x)
Definition: ad.hpp:3324
const trait_passive_value< typename ad::internal::binary_intermediate_aa< AD_TAPE_REAL, A1_T1, A1_T2, A1_OP >::VALUE_TYPE >::RETURN_TYPE RETURN_TYPE
Definition: ad.hpp:3347
static RETURN_TYPE & value(const ad::internal::binary_intermediate_aa< AD_TAPE_REAL, A1_T1, A1_T2, A1_OP > &x)
Definition: ad.hpp:3348
const trait_passive_value< typename ad::internal::binary_intermediate_ap< AD_TAPE_REAL, A1_T1, A1_OP >::VALUE_TYPE >::RETURN_TYPE RETURN_TYPE
Definition: ad.hpp:3359
static RETURN_TYPE & value(const ad::internal::binary_intermediate_ap< AD_TAPE_REAL, A1_T1, A1_OP > &x)
Definition: ad.hpp:3360
static RETURN_TYPE & value(const ad::internal::binary_intermediate_pa< AD_TAPE_REAL, A1_T2, A1_OP > &x)
Definition: ad.hpp:3372
const trait_passive_value< typename ad::internal::binary_intermediate_pa< AD_TAPE_REAL, A1_T2, A1_OP >::VALUE_TYPE >::RETURN_TYPE RETURN_TYPE
Definition: ad.hpp:3371
static RETURN_TYPE & value(const ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &x)
Definition: ad.hpp:3336
const trait_passive_value< typename ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP >::VALUE_TYPE >::RETURN_TYPE RETURN_TYPE
Definition: ad.hpp:3335
Definition: ad.hpp:3315
static RETURN_TYPE value(ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &value)
Definition: ad.hpp:3428
ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >::DATA_TYPE::TAPE_INDEX_TYPE RETURN_TYPE
Definition: ad.hpp:3427
ad::internal::binary_intermediate_aa< AD_TAPE_REAL, A1_T1, A1_T2, A1_OP >::DATA_TYPE::TAPE_INDEX_TYPE RETURN_TYPE
Definition: ad.hpp:3451
static RETURN_TYPE value(ad::internal::binary_intermediate_aa< AD_TAPE_REAL, A1_T1, A1_T2, A1_OP > &value)
Definition: ad.hpp:3452
ad::internal::binary_intermediate_ap< AD_TAPE_REAL, A1_T1, A1_OP >::DATA_TYPE::TAPE_INDEX_TYPE RETURN_TYPE
Definition: ad.hpp:3463
static RETURN_TYPE value(ad::internal::binary_intermediate_ap< AD_TAPE_REAL, A1_T1, A1_OP > &value)
Definition: ad.hpp:3464
ad::internal::binary_intermediate_pa< AD_TAPE_REAL, A1_T2, A1_OP >::DATA_TYPE::TAPE_INDEX_TYPE RETURN_TYPE
Definition: ad.hpp:3475
static RETURN_TYPE value(ad::internal::binary_intermediate_pa< AD_TAPE_REAL, A1_T2, A1_OP > &value)
Definition: ad.hpp:3476
static RETURN_TYPE value(ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &value)
Definition: ad.hpp:3440
ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP >::DATA_TYPE::TAPE_INDEX_TYPE RETURN_TYPE
Definition: ad.hpp:3439
ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >::DATA_TYPE::TAPE_INDEX_TYPE RETURN_TYPE
Definition: ad.hpp:3433
static RETURN_TYPE value(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &value)
Definition: ad.hpp:3434
static RETURN_TYPE value(const ad::internal::binary_intermediate_aa< AD_TAPE_REAL, A1_T1, A1_T2, A1_OP > &value)
Definition: ad.hpp:3458
ad::internal::binary_intermediate_aa< AD_TAPE_REAL, A1_T1, A1_T2, A1_OP >::DATA_TYPE::TAPE_INDEX_TYPE RETURN_TYPE
Definition: ad.hpp:3457
ad::internal::binary_intermediate_ap< AD_TAPE_REAL, A1_T1, A1_OP >::DATA_TYPE::TAPE_INDEX_TYPE RETURN_TYPE
Definition: ad.hpp:3469
static RETURN_TYPE value(const ad::internal::binary_intermediate_ap< AD_TAPE_REAL, A1_T1, A1_OP > &value)
Definition: ad.hpp:3470
ad::internal::binary_intermediate_pa< AD_TAPE_REAL, A1_T2, A1_OP >::DATA_TYPE::TAPE_INDEX_TYPE RETURN_TYPE
Definition: ad.hpp:3481
static RETURN_TYPE value(const ad::internal::binary_intermediate_pa< AD_TAPE_REAL, A1_T2, A1_OP > &value)
Definition: ad.hpp:3482
ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP >::DATA_TYPE::TAPE_INDEX_TYPE RETURN_TYPE
Definition: ad.hpp:3445
static RETURN_TYPE value(const ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &value)
Definition: ad.hpp:3446
Definition: ad.hpp:3419
AD_TAPE_INT RETURN_TYPE
Definition: ad.hpp:3420
static RETURN_TYPE value(const T &vvalue)
Definition: ad.hpp:3421
static RETURN_TYPE & value(ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &value)
Definition: ad.hpp:3249
ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >::VALUE_TYPE RETURN_TYPE
Definition: ad.hpp:3248
ad::internal::binary_intermediate_aa< AD_TAPE_REAL, A1_T1, A1_T2, A1_OP >::VALUE_TYPE RETURN_TYPE
Definition: ad.hpp:3272
static RETURN_TYPE & value(ad::internal::binary_intermediate_aa< AD_TAPE_REAL, A1_T1, A1_T2, A1_OP > &value)
Definition: ad.hpp:3273
ad::internal::binary_intermediate_ap< AD_TAPE_REAL, A1_T1, A1_OP >::VALUE_TYPE RETURN_TYPE
Definition: ad.hpp:3284
static RETURN_TYPE & value(ad::internal::binary_intermediate_ap< AD_TAPE_REAL, A1_T1, A1_OP > &value)
Definition: ad.hpp:3285
ad::internal::binary_intermediate_pa< AD_TAPE_REAL, A1_T2, A1_OP >::VALUE_TYPE RETURN_TYPE
Definition: ad.hpp:3296
static RETURN_TYPE & value(ad::internal::binary_intermediate_pa< AD_TAPE_REAL, A1_T2, A1_OP > &value)
Definition: ad.hpp:3297
static RETURN_TYPE & value(ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &value)
Definition: ad.hpp:3261
ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP >::VALUE_TYPE RETURN_TYPE
Definition: ad.hpp:3260
const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 >::VALUE_TYPE RETURN_TYPE
Definition: ad.hpp:3254
static RETURN_TYPE & value(const ad::internal::active_type< AD_TAPE_REAL, DATA_HANDLER_1 > &value)
Definition: ad.hpp:3255
const ad::internal::binary_intermediate_aa< AD_TAPE_REAL, A1_T1, A1_T2, A1_OP >::VALUE_TYPE RETURN_TYPE
Definition: ad.hpp:3278
static RETURN_TYPE & value(const ad::internal::binary_intermediate_aa< AD_TAPE_REAL, A1_T1, A1_T2, A1_OP > &value)
Definition: ad.hpp:3279
static RETURN_TYPE & value(const ad::internal::binary_intermediate_ap< AD_TAPE_REAL, A1_T1, A1_OP > &value)
Definition: ad.hpp:3291
const ad::internal::binary_intermediate_ap< AD_TAPE_REAL, A1_T1, A1_OP >::VALUE_TYPE RETURN_TYPE
Definition: ad.hpp:3290
static RETURN_TYPE & value(const ad::internal::binary_intermediate_pa< AD_TAPE_REAL, A1_T2, A1_OP > &value)
Definition: ad.hpp:3303
const ad::internal::binary_intermediate_pa< AD_TAPE_REAL, A1_T2, A1_OP >::VALUE_TYPE RETURN_TYPE
Definition: ad.hpp:3302
const ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP >::VALUE_TYPE RETURN_TYPE
Definition: ad.hpp:3266
static RETURN_TYPE & value(const ad::internal::unary_intermediate< AD_TAPE_REAL, A1_T, A1_OP > &value)
Definition: ad.hpp:3267
Definition: ad.hpp:3241
T RETURN_TYPE
Definition: ad.hpp:3242
static RETURN_TYPE & value(T &value)
Definition: ad.hpp:3243