1 # ifndef CPPAD_CORE_BASE_COMPLEX_HPP
2 # define CPPAD_CORE_BASE_COMPLEX_HPP
13 # include <cppad/configure.hpp>
88 const std::complex<double> &left ,
89 const std::complex<double> &right ,
90 const std::complex<double> &trueCase ,
91 const std::complex<double> &falseCase )
93 true , __LINE__ , __FILE__ ,
94 "std::complex<float> CondExpOp(...)",
95 "Error: cannot use CondExp with a complex type"
97 return std::complex<double>(0);
120 const std::complex<double> &x ,
121 const std::complex<double> &y )
135 {
return (x == std::complex<double>(0., 0.) ); }
137 {
return (x == std::complex<double>(1., 0.) ); }
139 const std::complex<double> &x,
const std::complex<double> &y)
147 # undef CPPAD_USER_MACRO
148 # define CPPAD_USER_MACRO(Fun) \
149 inline bool Fun(const std::complex<double>& x) \
150 { CppAD::ErrorHandler::Call( \
151 true , __LINE__ , __FILE__ , \
153 "Error: cannot use " #Fun " with x complex<double> " \
163 const std::complex<
double>& x ,
164 const std::complex<
double>& y )
175 inline int Integer(
const std::complex<double> &x)
176 {
return static_cast<int>( x.real() ); }
199 inline bool isnan(
const std::complex<double>& z)
226 # undef CPPAD_USER_MACRO
227 # define CPPAD_USER_MACRO(Fun) \
228 inline std::complex<double> Fun(const std::complex<double>& x) \
229 { CppAD::ErrorHandler::Call( \
230 true , __LINE__ , __FILE__ , \
232 "Error: cannot use " #Fun " with x complex<double> " \
234 return std::complex<double>(0); \
243 # if CPPAD_USE_CPLUSPLUS_2011
259 inline std::complex<double>
pow(
260 const std::complex<double> &x ,
261 const std::complex<double> &y )
285 # undef CPPAD_USER_MACRO_ONE
286 # define CPPAD_USER_MACRO_ONE(Fun) \
287 inline bool Fun(const std::complex<float>& x) \
288 { CppAD::ErrorHandler::Call( \
289 true , __LINE__ , __FILE__ , \
291 "Error: cannot use " #Fun " with x complex<float> " \
295 # undef CPPAD_USER_MACRO_TWO
296 # define CPPAD_USER_MACRO_TWO(Fun) \
297 inline std::complex<float> Fun(const std::complex<float>& x) \
298 { CppAD::ErrorHandler::Call( \
299 true , __LINE__ , __FILE__ , \
301 "Error: cannot use " #Fun " with x complex<float> " \
303 return std::complex<float>(0); \
309 const std::complex<float> &left ,
310 const std::complex<float> &right ,
311 const std::complex<float> &trueCase ,
312 const std::complex<float> &falseCase )
314 true , __LINE__ , __FILE__ ,
315 "std::complex<float> CondExpOp(...)",
316 "Error: cannot use CondExp with a complex type"
318 return std::complex<float>(0);
324 const std::complex<
float> &x ,
325 const std::complex<
float> &y )
332 {
return (x == std::complex<float>(0., 0.) ); }
334 {
return (x == std::complex<float>(1., 0.) ); }
336 const std::complex<float> &x,
const std::complex<float> &y)
344 const std::complex<
float>& x ,
345 const std::complex<
float>& y )
348 inline int Integer(
const std::complex<float> &x)
349 {
return static_cast<int>( x.real() ); }
351 inline bool isnan(
const std::complex<float>& z)
369 inline std::complex<
float>
pow(
370 const std::complex<
float> &x ,
371 const std::complex<
float> &y )
380 # undef CPPAD_USER_MACRO
381 # undef CPPAD_USER_MACRO_ONE
382 # undef CPPAD_USER_MACRO_TWO
std::complex< double > erf(const std::complex< double > &x)
AD< Base > cosh(const AD< Base > &x)
AD< Base > log(const AD< Base > &x)
#define CPPAD_USER_MACRO(Fun)
std::complex< double > atan(const std::complex< double > &x)
AD< Base > sinh(const AD< Base > &x)
Define the CppAD error checking macros (all of which begin with CPPAD_ASSERT_)
bool GreaterThanOrZero(const std::complex< double > &x)
#define CPPAD_AZMUL(Base)
AD< Base > abs(const AD< Base > &x)
std::complex< double > acos(const std::complex< double > &x)
bool IdenticalPar(const std::complex< double > &x)
bool EqualOpSeq(const std::complex< double > &x, const std::complex< double > &y)
bool IdenticalZero(const std::complex< double > &x)
AD< Base > exp(const AD< Base > &x)
std::complex< double > asinh(const std::complex< double > &x)
bool abs_geq(const std::complex< double > &x, const std::complex< double > &y)
bool isnan(const Scalar &s)
static void Call(bool known, int line, const char *file, const char *exp, const char *msg)
std::complex< double > acosh(const std::complex< double > &x)
Type pow(const Type &x, const int &n)
bool LessThanOrZero(const std::complex< double > &x)
std::complex< double > expm1(const std::complex< double > &x)
AD< Base > sqrt(const AD< Base > &x)
#define CPPAD_USER_MACRO_ONE(Fun)
#define CPPAD_NUMERIC_LIMITS(Other, Base)
std::complex< double > atanh(const std::complex< double > &x)
AD< Base > sin(const AD< Base > &x)
#define CPPAD_TO_STRING(Base)
std::complex< double > sign(const std::complex< double > &x)
bool IdenticalEqualPar(const std::complex< double > &x, const std::complex< double > &y)
AD< Base > cos(const AD< Base > &x)
#define CPPAD_USER_MACRO_TWO(Fun)
bool IdenticalOne(const std::complex< double > &x)
std::complex< double > asin(const std::complex< double > &x)
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.
File used to define the CppAD multi-threading allocator class.
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)
std::complex< double > fabs(const std::complex< double > &x)
bool GreaterThanZero(const std::complex< double > &x)
#define CPPAD_STANDARD_MATH_UNARY(Type, Fun)
This macro defines the function.
std::complex< double > log1p(const std::complex< double > &x)