36 #if defined(_GLUCAT_USE_QD) 37 # include <qd/qd_real.h> 48 numeric_traits<double>::
49 promoted {
typedef dd_real type;};
54 numeric_traits<long double>::
55 promoted {
typedef dd_real type;};
57 #define _GLUCAT_QD_F(_T, _F) \ 61 numeric_traits<_T>:: \ 70 isNaN(
const dd_real& val)
71 {
return val.isnan(); }
78 isInf(
const dd_real& val)
79 {
return val.isinf(); }
87 {
return val.isnan() || val.isinf(); }
95 { return ::to_int(val); }
103 { return ::to_double(val); }
108 numeric_traits<dd_real>::
109 promoted {
typedef qd_real type;};
114 numeric_traits<dd_real>::
115 demoted {
typedef double type;};
122 fmod(
const dd_real& lhs,
const dd_real& rhs)
123 { return ::fmod(lhs, rhs); }
130 pow(
const dd_real& val,
int n)
132 dd_real result = 1.0;
134 for (
int k = n; k != 0; pow2 *= pow2, k /= 2)
146 {
return dd_real::_pi; }
154 {
return dd_real::_log2; }
157 _GLUCAT_QD_F(dd_real,
exp)
160 _GLUCAT_QD_F(dd_real,
log)
163 _GLUCAT_QD_F(dd_real,
cos)
166 _GLUCAT_QD_F(dd_real,
acos)
169 _GLUCAT_QD_F(dd_real,
cosh)
172 _GLUCAT_QD_F(dd_real,
sin)
175 _GLUCAT_QD_F(dd_real,
asin)
178 _GLUCAT_QD_F(dd_real,
sinh)
181 _GLUCAT_QD_F(dd_real,
tan)
184 _GLUCAT_QD_F(dd_real,
atan)
187 _GLUCAT_QD_F(dd_real,
tanh)
194 isNaN(
const qd_real& val)
195 {
return val.isnan(); }
202 isInf(
const qd_real& val)
203 {
return val.isinf(); }
211 {
return val.isnan() || val.isinf(); }
218 to_int(
const qd_real& val)
219 { return ::to_int(val); }
227 { return ::to_double(val); }
232 numeric_traits<qd_real>::
233 promoted {
typedef qd_real type;};
238 numeric_traits<qd_real>::
239 demoted {
typedef qd_real type;};
246 fmod(
const qd_real& lhs,
const qd_real& rhs)
247 { return ::fmod(lhs, rhs); }
254 pow(
const qd_real& val,
int n)
256 qd_real result = 1.0;
258 for (
int k = n; k != 0; pow2 *= pow2, k /= 2)
270 {
return qd_real::_pi; }
278 {
return qd_real::_log2; }
281 _GLUCAT_QD_F(qd_real,
exp)
284 _GLUCAT_QD_F(qd_real,
log)
287 _GLUCAT_QD_F(qd_real,
cos)
290 _GLUCAT_QD_F(qd_real,
acos)
293 _GLUCAT_QD_F(qd_real,
cosh)
296 _GLUCAT_QD_F(qd_real,
sin)
299 _GLUCAT_QD_F(qd_real,
asin)
302 _GLUCAT_QD_F(qd_real,
sinh)
305 _GLUCAT_QD_F(qd_real,
tan)
308 _GLUCAT_QD_F(qd_real,
atan)
311 _GLUCAT_QD_F(qd_real,
tanh)
317 #endif // _GLUCAT_QD_H static int to_int(const Scalar_T &val)
Cast to int.
static bool isNaN_or_isInf(const Scalar_T &val)
Smart isnan or isinf.
const Multivector< Scalar_T, LO, HI > sinh(const Multivector< Scalar_T, LO, HI > &val)
Hyperbolic sine of multivector.
const Multivector< Scalar_T, LO, HI > log(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Natural logarithm of multivector with specified complexifier.
static bool isInf(const Scalar_T &val, bool_to_type< false >)
Smart isinf specialised for Scalar_T without infinity.
static Scalar_T fmod(const Scalar_T &lhs, const Scalar_T &rhs)
Modulo function for scalar.
const Multivector< Scalar_T, LO, HI > sin(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Sine of multivector with specified complexifier.
const framed_multi< Scalar_T, LO, HI > exp(const framed_multi< Scalar_T, LO, HI > &val)
Exponential of multivector.
const Multivector< Scalar_T, LO, HI > cos(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Cosine of multivector with specified complexifier.
const Multivector< Scalar_T, LO, HI > tanh(const Multivector< Scalar_T, LO, HI > &val)
Hyperbolic tangent of multivector.
const Multivector< Scalar_T, LO, HI > asin(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Inverse sine of multivector with specified complexifier.
static Scalar_T pow(const Scalar_T &val, int n)
Integer power.
static double to_double(const Scalar_T &val)
Cast to double.
const Multivector< Scalar_T, LO, HI > atan(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Inverse tangent of multivector with specified complexifier.
const Multivector< Scalar_T, LO, HI > tan(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Tangent of multivector with specified complexifier.
static Scalar_T ln_2()
log(2)
const Multivector< Scalar_T, LO, HI > acos(const Multivector< Scalar_T, LO, HI > &val, const Multivector< Scalar_T, LO, HI > &i, const bool prechecked=false)
Inverse cosine of multivector with specified complexifier.
const Multivector< Scalar_T, LO, HI > cosh(const Multivector< Scalar_T, LO, HI > &val)
Hyperbolic cosine of multivector.
static bool isNaN(const Scalar_T &val, bool_to_type< false >)
Smart isnan specialised for Scalar_T without quiet NaN.