CppAD: A C++ Algorithmic Differentiation Package  20171217
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
zdouble.hpp
Go to the documentation of this file.
1 # ifndef CPPAD_CORE_ZDOUBLE_HPP
2 # define CPPAD_CORE_ZDOUBLE_HPP
3 /* --------------------------------------------------------------------------
4 CppAD: C++ Algorithmic Differentiation: Copyright (C) 2003-17 Bradley M. Bell
5 
6 CppAD is distributed under multiple licenses. This distribution is under
7 the terms of the
8  Eclipse Public License Version 1.0.
9 
10 A copy of this license is included in the COPYING file of this distribution.
11 Please visit http://www.coin-or.org/CppAD/ for information on other licenses.
12 -------------------------------------------------------------------------- */
13 /*
14 $begin zdouble$$
15 $spell
16  zdouble
17  op
18  bool
19  inf
20  CppAD
21 $$
22 $section zdouble: An AD Base Type With Absolute Zero$$
23 
24 $head Deprecated 2015-09-26$$
25 Use the function $cref azmul$$ instead.
26 
27 $head Absolute Zero$$
28 The $code zdouble$$ class acts like the $code double$$ type
29 with the added property that zero times any value is zero.
30 This includes zero time $cref nan$$ and zero times infinity.
31 In addition, zero divided by any value and any value times zero
32 are also zero.
33 
34 $head Syntax$$
35 
36 $subhead Constructor and Assignment$$
37 $codei% zdouble z
38 %$$
39 $codei% zdouble z(x)
40 %$$
41 $icode% z1% %op% %x%
42 %$$
43 where $icode x$$ is a $code double$$ or $code zdouble$$ object
44 and $icode op$$ is $code =$$, $code +=$$, $code -=$$, $code *=$$
45 or $code /=-$$.
46 
47 $subhead Comparison Operators$$
48 $icode% b% = %z% %op% %x%
49 %$$
50 $icode% b% = %x% %op% %z%
51 %$$
52 where $icode b$$ is a $code bool$$ object,
53 $icode z$$ is a $code zdouble$$ object,
54 $icode x$$ is a $code double$$ or $code zdouble$$ object, and
55 $icode op$$ is $code ==$$, $code !=$$, $code <=$$, $code >=$$,
56 $code <$$ or $code >$$.
57 
58 $subhead Arithmetic Operators$$
59 $icode% z2% = %z1% %op% %x%
60 %$$
61 $icode% z2% = %x% %op% %z1%
62 %$$
63 where $icode z1$$, $icode z2$$ are $code zdouble$$ objects,
64 $icode x$$ is a $code double$$ or $code zdouble$$ object, and
65 $icode op$$ is $code +$$, $code -$$, $code *$$ or $code /$$.
66 
67 
68 $subhead Standard Math$$
69 $icode% z2% = %fun%(%z1%)
70 %$$
71 $icode% z3% = pow(%z1%, %z2%)
72 %$$
73 where $icode z1$$, $icode z2$$, $icode z3$$ are $code zdouble$$ objects and
74 $icode fun$$ is a $cref unary_standard_math$$ function.
75 
76 $subhead Nan$$
77 There is a specialization of $cref nan$$ so that
78 $icode%
79  z2% = nan(%z1%)
80 %$$
81 returns 'not a number' when $icode z1$$ has type $code zdouble$$.
82 Note that this template function needs to be specialized because
83 $codei
84  zdouble(0.0) == zdouble(0.0) / zdouble(0.0)
85 $$
86 
87 
88 $head Motivation$$
89 
90 $subhead General$$
91 Often during computing (and more so in parallel computing) alternative
92 values for an expression are computed and one of the alternatives
93 is chosen using some boolean variable.
94 This is often represented by
95 $codei%
96  %result% = %flag% * %value_if_true% + (1 - %flag%) * %value_if_false%
97 %$$
98 where $icode flag$$ is one for true and zero for false.
99 This representation does not work for $code double$$ when the value
100 being multiplied by zero is $code +inf$$, $code -inf$$, or $code nan$$.
101 
102 $subhead CppAD$$
103 In CppAD one can use
104 $cref/conditional expressions/CondExp/$$ to achieve the representation
105 $codei%
106  %result% = %flag% * %value_if_true% + (1 - %flag%) * %value_if_false%
107 %$$
108 This works fine except when there are
109 $cref/multiple levels of AD/mul_level/$$; e.g.,
110 when using $codei%AD< AD<double> >%$$.
111 In this case the corresponding AD function objects have type
112 $cref/ADFun< AD<double> >/FunConstruct/$$.
113 When these AD function objects compute derivatives using
114 $cref reverse$$ mode, the conditional expressions are represented use
115 zeros to multiply the expression that is not used.
116 Using $codei%AD< AD<zdouble> >%$$ instead of $code AD< AD<double> >$$
117 makes this representation work and fixes the problem.
118 
119 $head Base Type Requirements$$
120 The type $code zdouble$$ satisfies all of the CppAD
121 $cref/base type requirements/base_require/$$.
122 
123 $children%
124  example/deprecated/zdouble.cpp
125 %$$
126 $head Example$$
127 The file $cref zdouble.cpp$$
128 contains an example and test of this class.
129 It returns true if it succeeds and false otherwise.
130 
131 $end
132 */
133 # include <cppad/base_require.hpp>
134 # include <cppad/utility/nan.hpp>
135 
136 /*!
137 \file zdouble.hpp
138 Define a class like double but with an absolute zero.
139 */
140 
141 /*!
142 \def CPPAD_ZDOUBLE_NORMAL_ASSIGN_OPERATOR(op)
143 Define a compound assignment member operator that functions the same
144 as corresponding double operator.
145 */
146 # define CPPAD_ZDOUBLE_NORMAL_ASSIGN_OPERATOR(op) \
147  zdouble& operator op (const zdouble& z) \
148  { dbl_ op z.dbl_; \
149  return *this; \
150  } \
151  zdouble& operator op (const double& x) \
152  { dbl_ op x; \
153  return *this; \
154  }
155 
156 /*!
157 \def CPPAD_ZDOUBLE_UNARY_OPERATOR(op)
158 Define a unary compound assignment member operator.
159 */
160 # define CPPAD_ZDOUBLE_UNARY_OPERATOR(op) \
161  zdouble operator op (void) const \
162  { return zdouble( op dbl_ ); }
163 
164 /*!
165 # define CPPAD_ZDOUBLE_NORMAL_BINARY_OPERATOR(op)
166 Define a binary arithmetic member operator that functions the same
167 as corresponding double operator.
168 */
169 # define CPPAD_ZDOUBLE_NORMAL_BINARY_OPERATOR(op) \
170  zdouble operator op (const zdouble& z) const \
171  { return zdouble( dbl_ op z.dbl_ ); } \
172  zdouble operator op (const double& x) const \
173  { return zdouble( dbl_ op x ); }
174 
175 /*!
176 \def CPPAD_ZDOUBLE_COMPARE_OPERATOR(op)
177 Define a comparison member operator.
178 */
179 # define CPPAD_ZDOUBLE_COMPARE_OPERATOR(op) \
180  bool operator op (const zdouble& z) const \
181  { return dbl_ op z.dbl_; } \
182  bool operator op (const double& x) const \
183  { return dbl_ op x; }
184 
185 /*!
186 \def CPPAD_ZDOUBLE_OTHER_BINARY_OPERATOR(op)
187 Define a binary arithmetic operator that is not a member because
188 the double operand is on the left.
189 */
190 # define CPPAD_ZDOUBLE_OTHER_BINARY_OPERATOR(op) \
191  inline zdouble operator op(const double& x, const zdouble& z) \
192  { return zdouble(x) op z; }
193 
194 /*!
195 \def CPPAD_ZDOUBLE_OTHER_COMPARE_OPERATOR(op, op_switch)
196 Define a comparison operator that is not a member because
197 the double operand is on the left.
198 Convert it to the case where the double operand is on the right by
199 by using op_switch instead of op.
200 */
201 # define CPPAD_ZDOUBLE_OTHER_COMPARE_OPERATOR(op, op_switch) \
202  inline bool operator op(const double& x, const zdouble& z) \
203  { return z op_switch x; }
204 
205 /*!
206 \def CPPAD_ZDOUBLE_STD_MATH_FRIEND(fun)
207 Declare that a standard math function is a friend.
208 */
209 # define CPPAD_ZDOUBLE_STD_MATH_FRIEND(fun) \
210  friend zdouble fun(const zdouble& z);
211 /*!
212 \def CPPAD_ZDOUBLE_STD_MATH(fun)
213 Define a standard math function.
214 */
215 # define CPPAD_ZDOUBLE_STD_MATH(fun) \
216  inline zdouble fun(const zdouble& z ) \
217  { return zdouble( std::fun(z.dbl_) ); }
218 
219 namespace CppAD { // CPPAD_BEGIN_NAMESPACDE
220 
221 
222 /*!
223 Class that is like double, except that it has an absolute zero.
224 */
225 class zdouble {
226  /*!
227  For zdouble objects z1, z2, and std::ostream os,
228  declare the following friends:
229  \code
230  os << z1
231  Integer(z1)
232  fabs(z1)
233  pow(z1, z2)
234  fabs_geq(z1, z2)
235  fun(z1)
236  \endcode
237  where fun is any of the standard math unary functions.
238  */
239  friend std::ostream& operator << (std::ostream &os, const zdouble& z);
240  friend int Integer(const zdouble& z);
241  friend zdouble pow(const zdouble& x, const zdouble& y);
242  friend bool abs_geq(const zdouble& x, const zdouble& y);
243  //
258  //
259 # if CPPAD_USE_CPLUSPLUS_2011
266  //
267 # endif
268 private:
269  /// The value for this object
270  double dbl_;
271 public:
272  /// Default constructor
273  zdouble(void)
274  : dbl_()
275  { }
276  /// Copy constructor
277  zdouble(const zdouble& z)
278  : dbl_(z.dbl_)
279  { }
280  /// Constructor from double
281  zdouble(const double& dbl)
282  : dbl_(dbl)
283  { }
284  //
285  /// Destructor
286  ~zdouble(void)
287  { }
288  //
289  /// Assignment from zdouble
291  { dbl_ = z.dbl_;
292  return *this;
293  }
294  /// Assignment from double
295  zdouble& operator=(const double& dbl)
296  { dbl_ = dbl;
297  return *this;
298  }
299  //
300  /// Normal compound assignment
302  /// Normal compound assignment
304  /// Normal unary operator
306  /// Normal unary operator
308  /// Normal compare operator
310  /// Normal compare operator
312  /// Normal compare operator
314  /// Normal compare operator
316  /// Normal compare operator
318  /// Normal compare operator
320  //
321  /// Normal binary arithmetic operator
323  /// Normal binary arithmetic operator
325  //
326  /// Binary arithmetic * with absolute zero
327  zdouble operator * (const zdouble& z) const
328  { bool zero = (dbl_ == 0.0) || (z.dbl_ == 0.0);
329  return zdouble( zero ? 0.0 : (dbl_ * z.dbl_) );
330  }
331  /// Binary arithmetic * with absolute zero
332  zdouble operator * (const double& x) const
333  { bool zero = (dbl_ == 0.0) || (x == 0.0);
334  return zdouble( zero ? 0.0 : (dbl_ * x) );
335  }
336  /// Binary arithmetic / with absolute zero
337  zdouble operator / (const zdouble& z) const
338  { bool zero = (dbl_ == 0.0);
339  return zdouble( zero ? 0.0 : (dbl_ / z.dbl_) );
340  }
341  /// Binary arithmetic / with absolute zero
342  zdouble operator / (const double& x) const
343  { bool zero = (dbl_ == 0.0);
344  return zdouble( zero ? 0.0 : (dbl_ / x) );
345  }
346  //
347  /// Compute assignmnet *= with absolute zero
349  { bool zero = (dbl_ == 0.0) || (z.dbl_ == 0.0);
350  zero ? (dbl_ = 0.0) : (dbl_ *= z.dbl_);
351  return *this;
352  }
353  /// Compute assignmnet *= with absolute zero
354  zdouble& operator *= (const double& x)
355  { bool zero = (dbl_ == 0.0) || (x == 0.0);
356  zero ? (dbl_ = 0.0) : (dbl_ *= x);
357  return *this;
358  }
359  //
360  /// Compute assignmnet /= with absolute zero
362  { bool zero = (dbl_ == 0.0);
363  zero ? (dbl_ = 0.0) : (dbl_ /= z.dbl_);
364  return *this;
365  }
366  /// Compute assignmnet /= with absolute zero
367  zdouble& operator /= (const double& x)
368  { bool zero = (dbl_ == 0.0);
369  zero ? (dbl_ = 0.0) : (dbl_ /= x);
370  return *this;
371  }
372 };
373 // BEGIN nan
374 /// Must specialize CppAD::nan because zdouble 0/0 is not nan.
375 template <>
376 inline zdouble nan<zdouble>(const zdouble& zero)
377 {
378  return zdouble( std::numeric_limits<double>::quiet_NaN() );
379 }
380 // END nan
381 //
382 /// Normal non-member compare operator
384 /// Normal non-member compare operator
386 /// Normal non-member compare operator
388 /// Normal non-member compare operator
390 /// Normal non-member compare operator
392 /// Normal non-member compare operator
394 //
395 /// Normal binary arithmetic operator
397 /// Normal binary arithmetic operator
399 /// Binary arithmetic operator with absolute zero
401 /// Binary arithmetic operator with absolute zero
403 // -------------------------------------------------------------------------
404 // Base type requirements
405 // -------------------------------------------------------------------------
406 
407 /// Base type requirement: CondExpOp
409  enum CompareOp cop ,
410  const zdouble& left ,
411  const zdouble& right ,
412  const zdouble& exp_if_true ,
413  const zdouble& exp_if_false )
414 { return CondExpTemplate(cop, left, right, exp_if_true, exp_if_false);
415 }
416 
417 /// Base type requirement: CondExpRel
418 CPPAD_COND_EXP_REL(zdouble)
419 
420 /// Base type requirement: EqualOpSeq
421 inline bool EqualOpSeq(const zdouble& x, const zdouble& y)
422 { return x == y; }
423 
424 /// Base type requirement: Identical
425 inline bool IdenticalPar(const zdouble& x)
426 { return true; }
427 inline bool IdenticalZero(const zdouble& x)
428 { return (x == 0.0); }
429 inline bool IdenticalOne(const zdouble& x)
430 { return (x == 1.); }
431 inline bool IdenticalEqualPar(const zdouble& x, const zdouble& y)
432 { return (x == y); }
433 
434 /// Base type requirement: output operator
435 inline std::ostream& operator << (std::ostream &os, const zdouble& z)
436 { os << z.dbl_;
437  return os;
438 }
439 
440 /// Base type requirement: Integer
441 inline int Integer(const zdouble& x)
442 { return static_cast<int>(x.dbl_); }
443 
444 /// Base type requirement: azmul
445 inline zdouble azmul(const zdouble& x, const zdouble& y)
446 { return x * y; }
447 
448 /// Base type requirement: Ordered
449 inline bool GreaterThanZero(const zdouble& x)
450 { return x > 0.0; }
451 inline bool GreaterThanOrZero(const zdouble& x)
452 { return x >= 0.0; }
453 inline bool LessThanZero(const zdouble& x)
454 { return x < 0.0; }
455 inline bool LessThanOrZero(const zdouble& x)
456 { return x <= 0.0; }
457 inline bool abs_geq(const zdouble& x, const zdouble& y)
458 { return std::fabs(x.dbl_) >= std::fabs(y.dbl_); }
459 
460 /// Normal standard math function
462 /// Normal standard math function
464 /// Normal standard math function
466 /// Normal standard math function
468 /// Normal standard math function
470 /// Normal standard math function
472 /// Normal standard math function
474 /// Normal standard math function
476 /// Normal standard math function
478 /// Normal standard math function
480 /// Normal standard math function
482 /// Normal standard math function
484 /// Normal standard math function
486 /// Normal standard math function
488 //
489 # if CPPAD_USE_CPLUSPLUS_2011
490 /// C++2011 standard math function
492 /// C++2011 standard math function
494 /// C++2011 standard math function
496 /// C++2011 standard math function
498 /// C++2011 standard math function
500 /// C++2011 standard math function
502 # endif
503 
504 /// Base type requirement: abs
505 inline zdouble abs(const zdouble& x)
506 { return fabs(x); }
507 
508 /// Base type requirement: sign
509 inline zdouble sign(const zdouble& x)
510 { if( x > 0.0 )
511  return zdouble(1.);
512  if( x == 0.0 )
513  return zdouble(0.0);
514  return zdouble(-1.);
515 }
516 
517 /// Base type requirement: pow
518 inline zdouble pow(const zdouble& x, const zdouble& y)
519 { return std::pow(x.dbl_, y.dbl_); }
520 
521 /// Base type requirement: limits
522 CPPAD_NUMERIC_LIMITS(double, zdouble)
523 
524 } // CPPAD_END_NAMESPACE
525 
526 /// undef all macros defined in this file
527 # undef CPPAD_ZDOUBLE_NORMAL_ASSIGN_OPERATOR
528 # undef CPPAD_ZDOUBLE_UNARY_OPERATOR
529 # undef CPPAD_ZDOUBLE_NORMAL_BINARY_OPERATOR
530 # undef CPPAD_ZDOUBLE_COMPARE_OPERATOR
531 # undef CPPAD_ZDOUBLE_OTHER_BINARY_OPERATOR
532 # undef CPPAD_ZDOUBLE_OTHER_COMPARE_OPERATOR
533 # undef CPPAD_ZDOUBLE_STD_MATH_FRIEND
534 # undef CPPAD_ZDOUBLE_STD_MATH
535 
536 # endif
std::complex< double > erf(const std::complex< double > &x)
AD< Base > cosh(const AD< Base > &x)
#define CPPAD_ZDOUBLE_NORMAL_ASSIGN_OPERATOR(op)
Define a compound assignment member operator that functions the same as corresponding double operator...
Definition: zdouble.hpp:146
friend zdouble log1p(const zdouble &z)
C++2011 standard math function.
Definition: zdouble.hpp:501
AD< Base > azmul(const AD< Base > &x, const AD< Base > &y)
Definition: azmul.hpp:94
friend zdouble fabs(const zdouble &z)
Normal standard math function.
Definition: zdouble.hpp:473
Class that is like double, except that it has an absolute zero.
Definition: zdouble.hpp:225
#define CPPAD_ZDOUBLE_OTHER_COMPARE_OPERATOR(op, op_switch)
Define a comparison operator that is not a member because the double operand is on the left...
Definition: zdouble.hpp:201
AD< Base > log(const AD< Base > &x)
friend zdouble tan(const zdouble &z)
Normal standard math function.
Definition: zdouble.hpp:485
std::ostream & operator<<(std::ostream &os, const CppAD::vector< Type > &vec)
output a vector
Definition: vector.hpp:577
friend zdouble cos(const zdouble &z)
Normal standard math function.
Definition: zdouble.hpp:467
~zdouble(void)
Destructor.
Definition: zdouble.hpp:286
std::complex< double > atan(const std::complex< double > &x)
#define CPPAD_ZDOUBLE_NORMAL_BINARY_OPERATOR(op)
define CPPAD_ZDOUBLE_NORMAL_BINARY_OPERATOR(op)Define a binary arithmetic member operator that functi...
Definition: zdouble.hpp:169
AD< Base > sinh(const AD< Base > &x)
#define CPPAD_ZDOUBLE_COMPARE_OPERATOR(op)
Define a comparison member operator.
Definition: zdouble.hpp:179
#define CPPAD_ZDOUBLE_UNARY_OPERATOR(op)
Define a unary compound assignment member operator.
Definition: zdouble.hpp:160
double dbl_
The value for this object.
Definition: zdouble.hpp:270
bool GreaterThanOrZero(const std::complex< double > &x)
friend zdouble log10(const zdouble &z)
Normal standard math function.
Definition: zdouble.hpp:477
ResultType CondExpTemplate(enum CompareOp cop, const CompareType &left, const CompareType &right, const ResultType &exp_if_true, const ResultType &exp_if_false)
Template function to implement Conditional Expressions for simple types that have comparision operato...
friend zdouble acosh(const zdouble &z)
C++2011 standard math function.
Definition: zdouble.hpp:495
AD< Base > abs(const AD< Base > &x)
Definition: abs.hpp:105
zdouble(const double &dbl)
Constructor from double.
Definition: zdouble.hpp:281
friend int Integer(const zdouble &z)
Base type requirement: Integer.
Definition: zdouble.hpp:441
friend zdouble sin(const zdouble &z)
Normal standard math function.
Definition: zdouble.hpp:479
zdouble & operator*=(const zdouble &z)
Compute assignmnet *= with absolute zero.
Definition: zdouble.hpp:348
std::complex< double > acos(const std::complex< double > &x)
bool IdenticalPar(const std::complex< double > &x)
zdouble nan< zdouble >(const zdouble &zero)
Must specialize CppAD::nan because zdouble 0/0 is not nan.
Definition: zdouble.hpp:376
AD< Base > tan(const AD< Base > &x)
bool EqualOpSeq(const std::complex< double > &x, const std::complex< double > &y)
friend zdouble atanh(const zdouble &z)
C++2011 standard math function.
Definition: zdouble.hpp:497
#define CPPAD_ZDOUBLE_STD_MATH_FRIEND(fun)
Declare that a standard math function is a friend.
Definition: zdouble.hpp:209
bool IdenticalZero(const std::complex< double > &x)
AD< Base > exp(const AD< Base > &x)
AD< Base > log10(const AD< Base > &x)
Compute the log of base 10 of x where has type AD&lt;Base&gt;
friend zdouble atan(const zdouble &z)
Normal standard math function.
Definition: zdouble.hpp:465
std::complex< double > asinh(const std::complex< double > &x)
bool abs_geq(const std::complex< double > &x, const std::complex< double > &y)
std::complex< double > acosh(const std::complex< double > &x)
Type pow(const Type &x, const int &n)
Definition: pow_int.hpp:116
zdouble & operator=(const zdouble &z)
Assignment from zdouble.
Definition: zdouble.hpp:290
bool LessThanOrZero(const std::complex< double > &x)
std::complex< double > expm1(const std::complex< double > &x)
friend zdouble expm1(const zdouble &z)
C++2011 standard math function.
Definition: zdouble.hpp:499
friend std::ostream & operator<<(std::ostream &os, const zdouble &z)
For zdouble objects z1, z2, and std::ostream os, declare the following friends:
Definition: zdouble.hpp:435
AD< Base > sqrt(const AD< Base > &x)
zdouble(const zdouble &z)
Copy constructor.
Definition: zdouble.hpp:277
friend zdouble erf(const zdouble &z)
C++2011 standard math function.
Definition: zdouble.hpp:491
AD< Base > tanh(const AD< Base > &x)
#define CPPAD_NUMERIC_LIMITS(Other, Base)
Definition: base_limits.hpp:49
zdouble operator*(const zdouble &z) const
Binary arithmetic * with absolute zero.
Definition: zdouble.hpp:327
std::complex< double > atanh(const std::complex< double > &x)
zdouble & operator=(const double &dbl)
Assignment from double.
Definition: zdouble.hpp:295
friend zdouble asin(const zdouble &z)
Normal standard math function.
Definition: zdouble.hpp:463
zdouble & operator/=(const zdouble &z)
Compute assignmnet /= with absolute zero.
Definition: zdouble.hpp:361
AD< Base > sin(const AD< Base > &x)
zdouble operator/(const zdouble &z) const
Binary arithmetic / with absolute zero.
Definition: zdouble.hpp:337
std::complex< double > sign(const std::complex< double > &x)
friend zdouble tanh(const zdouble &z)
Normal standard math function.
Definition: zdouble.hpp:487
bool IdenticalEqualPar(const std::complex< double > &x, const std::complex< double > &y)
AD< Base > cos(const AD< Base > &x)
friend zdouble acos(const zdouble &z)
Normal standard math function.
Definition: zdouble.hpp:461
bool IdenticalOne(const std::complex< double > &x)
friend zdouble exp(const zdouble &z)
Normal standard math function.
Definition: zdouble.hpp:471
std::complex< double > asin(const std::complex< double > &x)
friend zdouble log(const zdouble &z)
Normal standard math function.
Definition: zdouble.hpp:475
int Integer(const std::complex< double > &x)
bool LessThanZero(const std::complex< double > &x)
#define CPPAD_COND_EXP_REL(Type)
The macro defines the operations.
friend zdouble sqrt(const zdouble &z)
Normal standard math function.
Definition: zdouble.hpp:483
zdouble(void)
Default constructor.
Definition: zdouble.hpp:273
friend bool abs_geq(const zdouble &x, const zdouble &y)
Definition: zdouble.hpp:457
friend zdouble asinh(const zdouble &z)
C++2011 standard math function.
Definition: zdouble.hpp:493
std::complex< double > CondExpOp(enum CppAD::CompareOp cop, const std::complex< double > &left, const std::complex< double > &right, const std::complex< double > &trueCase, const std::complex< double > &falseCase)
#define CPPAD_ZDOUBLE_STD_MATH(fun)
Define a standard math function.
Definition: zdouble.hpp:215
friend zdouble cosh(const zdouble &z)
Normal standard math function.
Definition: zdouble.hpp:469
std::complex< double > fabs(const std::complex< double > &x)
bool GreaterThanZero(const std::complex< double > &x)
friend zdouble pow(const zdouble &x, const zdouble &y)
Base type requirement: pow.
Definition: zdouble.hpp:518
friend zdouble sinh(const zdouble &z)
Normal standard math function.
Definition: zdouble.hpp:481
std::complex< double > log1p(const std::complex< double > &x)
#define CPPAD_ZDOUBLE_OTHER_BINARY_OPERATOR(op)
Define a binary arithmetic operator that is not a member because the double operand is on the left...
Definition: zdouble.hpp:190