41class csda :
public std::complex<T> {
43 using std::complex<T>::complex;
45 csda(
const std::complex<T>& a) : std::complex<T>(a) {}
47 operator T()
const {
return this->real(); }
49 csda<T>& operator=(
const T& a) {
50 ((std::complex<T>&)*
this) = a;
54 csda<T>& operator+=(
const T& a) {
55 ((std::complex<T>&)*
this) += a;
59 csda<T>& operator-=(
const T& a) {
60 ((std::complex<T>&)*
this) -= a;
64 csda<T>& operator*=(
const T& a) {
65 ((std::complex<T>&)*
this) *= a;
69 csda<T>& operator/=(
const T& a) {
70 ((std::complex<T>&)*
this) /= a;
75 csda<T>& operator=(
const std::complex<X>& a) {
76 ((std::complex<T>&)*
this) = a;
81 csda<T>& operator+=(
const std::complex<X>& a) {
82 ((std::complex<T>&)*
this) += a;
87 csda<T>& operator-=(
const std::complex<X>& a) {
88 ((std::complex<T>&)*
this) -= a;
93 csda<T>& operator*=(
const std::complex<X>& a) {
94 ((std::complex<T>&)*
this) *= a;
99 csda<T>& operator/=(
const std::complex<X>& a) {
100 ((std::complex<T>&)*
this) /= a;
106inline csda<T> operator+(csda<T> a,
const csda<T>& b) {
111inline csda<T> operator+(csda<T> a,
const T& b) {
116 typename T1,
typename T2,
class =
typename std::enable_if<std::is_integral<T2>::value>::type>
117inline csda<T1> operator+(csda<T1> a,
const T2& b) {
122inline const csda<T> operator+(
const T& a, csda<T> b) {
127 typename T1,
typename T2,
class =
typename std::enable_if<std::is_integral<T1>::value>::type>
128inline csda<T2> operator+(
const T1& a, csda<T2> b) {
133inline csda<T> operator-(csda<T> a,
const csda<T>& b) {
138inline csda<T> operator-(csda<T> a,
const T& b) {
143 typename T1,
typename T2,
class =
typename std::enable_if<std::is_integral<T2>::value>::type>
144inline csda<T1> operator-(csda<T1> a,
const T2& b) {
149inline const csda<T> operator-(
const T& a,
const csda<T>& b) {
150 return csda<T>(a) -= b;
154 typename T1,
typename T2,
class =
typename std::enable_if<std::is_integral<T1>::value>::type>
155inline const csda<T2> operator-(
const T1& a,
const csda<T2>& b) {
156 return csda<T2>(a) -= b;
160inline csda<T> operator*(csda<T> a,
const csda<T>& b) {
165inline csda<T> operator*(csda<T> a,
const T& b) {
170 typename T1,
typename T2,
class =
typename std::enable_if<std::is_integral<T2>::value>::type>
171inline csda<T1> operator*(csda<T1> a,
const T2& b) {
176inline csda<T> operator*(
const T& a, csda<T> b) {
181 typename T1,
typename T2,
class =
typename std::enable_if<std::is_integral<T1>::value>::type>
182inline csda<T2> operator*(
const T1& a, csda<T2> b) {
187inline csda<T> operator/(csda<T> a,
const csda<T>& b) {
192inline csda<T> operator/(csda<T> a,
const T& b) {
197 typename T1,
typename T2,
class =
typename std::enable_if<std::is_integral<T2>::value>::type>
198inline const csda<T1> operator/(csda<T1> a,
const T2& b) {
203inline const csda<T> operator/(
const T& a,
const csda<T>& b) {
204 return csda<T>(a) /= b;
208 typename T1,
typename T2,
class =
typename std::enable_if<std::is_integral<T1>::value>::type>
209inline const csda<T2> operator/(
const T1& a,
const csda<T2>& b) {
210 return csda<T2>(a) /= b;
214inline const csda<T> operator+(
const csda<T>& a) {
220inline const csda<T> operator-(
const csda<T>& a) {
221 return -std::complex<T>(a);
225template <
typename T1,
typename T2>
226inline bool operator==(
const csda<T1>& a,
const csda<T2>& b) {
227 return real(a) == real(b);
231template <
typename T1,
typename T2>
237template <
typename T1,
typename T2>
243template <
typename T1,
typename T2>
244inline bool operator!=(
const csda<T1>& a,
const csda<T2>& b) {
245 return real(a) != real(b);
249template <
typename T1,
typename T2>
255template <
typename T1,
typename T2>
261template <
typename T1,
typename T2>
262inline bool operator<(
const csda<T1>& a,
const csda<T2>& b) {
263 return real(a) < real(b);
267template <
typename T1,
typename T2>
273template <
typename T1,
typename T2>
279template <
typename T1,
typename T2>
280inline bool operator>(
const csda<T1>& a,
const csda<T2>& b) {
281 return real(a) > real(b);
285template <
typename T1,
typename T2>
291template <
typename T1,
typename T2>
297template <
typename T1,
typename T2>
298inline bool operator<=(
const csda<T1>& a,
const csda<T2>& b) {
299 return real(a) <= real(b);
303template <
typename T1,
typename T2>
309template <
typename T1,
typename T2>
315template <
typename T1,
typename T2>
316inline bool operator>=(
const csda<T1>& a,
const csda<T2>& b) {
317 return real(a) >= real(b);
321template <
typename T1,
typename T2>
327template <
typename T1,
typename T2>
335inline csda<T>
abs(
const csda<T>& a) {
336 if (real(a) < 0) {
return -std::complex<T>(a); }
343inline csda<T>
norm(
const csda<T>& a) {
349inline csda<T>
conj(
const csda<T>& a) {
354inline csda<T> proj(
const csda<T>& a) {
355 return std::proj(std::complex<T>(a));
360inline csda<T>
exp(
const csda<T>& a) {
361 return std::exp(std::complex<T>(a));
366inline csda<T>
log(
const csda<T>& a) {
367 return std::log(std::complex<T>(a));
372inline csda<T>
log10(
const csda<T>& a) {
373 return std::log10(std::complex<T>(a));
378inline csda<T>
pow(
const csda<T>& a,
const csda<T>& b) {
379 return std::pow(std::complex<T>(a), std::complex<T>(b));
383template <
typename T1,
typename T2>
384inline csda<T1>
pow(
const csda<T1>& a,
const T2& b) {
385 return std::pow(std::complex<T1>(a), b);
389template <
typename T1,
typename T2>
390inline csda<T2>
pow(
const T1& a,
const csda<T2>& b) {
391 return std::pow(a, std::complex<T2>(b));
396inline csda<T>
sqrt(
const csda<T>& a) {
397 return std::sqrt(std::complex<T>(a));
402inline csda<T>
sin(
const csda<T>& a) {
403 const T& x = a.real();
404 const T& y = a.imag();
405 return csda<T>(std::sin(x) * std::cosh(y), std::cos(x) * std::sinh(y));
410inline csda<T>
cos(
const csda<T>& a) {
411 const T& x = a.real();
412 const T& y = a.imag();
413 return csda<T>(std::cos(x) * std::cosh(y), -std::sin(x) * std::sinh(y));
418inline csda<T>
tan(
const csda<T>& a) {
419 return std::tan(std::complex<T>(a));
424inline csda<T>
asin(
const csda<T>& z) {
425 csda<T> u = -std::log(csda<T>(0, z) + std::sqrt(1 - z * z));
426 return csda<T>(u.imag(), u.real());
431inline csda<T>
acos(
const csda<T>& z) {
432 csda<T> u = -std::log(z + std::sqrt(z * z - 1));
433 return csda<T>(u.imag(), u.real());
438inline csda<T>
atan(
const csda<T>& a) {
439 return std::atan(std::complex<T>(a));
444inline csda<T>
sinh(
const csda<T>& a) {
445 return std::sinh(std::complex<T>(a));
450inline csda<T>
cosh(
const csda<T>& a) {
451 return std::cosh(std::complex<T>(a));
456inline csda<T>
tanh(
const csda<T>& a) {
457 return std::tanh(std::complex<T>(a));
462inline csda<T>
asinh(
const csda<T>& a) {
463 return std::asinh(std::complex<T>(a));
468inline csda<T>
acosh(
const csda<T>& a) {
469 return std::acosh(std::complex<T>(a));
474inline csda<T>
atanh(
const csda<T>& a) {
475 return std::atanh(std::complex<T>(a));
484class std::numeric_limits<
b2000::csda<T> > {
486 static constexpr bool is_specialized =
true;
487 static constexpr bool is_signed =
true;
488 static constexpr bool is_integer =
false;
489 static constexpr bool is_exact = numeric_limits<T>::is_exact;
490 static constexpr bool has_infinity = numeric_limits<T>::has_infinity;
491 static constexpr bool has_quiet_NaN = numeric_limits<T>::has_quiet_NaN;
492 static constexpr bool has_signaling_NaN = numeric_limits<T>::has_signaling_NaN;
493 static constexpr bool has_denorm = numeric_limits<T>::has_denorm;
494 static constexpr bool has_denorm_loss = numeric_limits<T>::has_denorm_loss;
495 static constexpr float_round_style round_style = numeric_limits<T>::round_style;
496 static constexpr bool is_iec559 = numeric_limits<T>::is_iec559;
497 static constexpr bool is_bounded = numeric_limits<T>::is_bounded;
498 static constexpr bool is_modulo = numeric_limits<T>::is_modulo;
499 static constexpr int digits = numeric_limits<T>::digits;
500 static constexpr int digits10 = numeric_limits<T>::digits10;
501 static constexpr int max_digits10 = numeric_limits<T>::max_digits10;
502 static constexpr int radix = numeric_limits<T>::radix;
503 static constexpr int min_exponent = numeric_limits<T>::min_exponent;
504 static constexpr int min_exponent10 = numeric_limits<T>::min_exponent10;
505 static constexpr int max_exponent = numeric_limits<T>::max_exponent;
506 static constexpr int max_exponent10 = numeric_limits<T>::max_exponent10;
507 static constexpr bool traps = numeric_limits<T>::traps;
508 static constexpr bool tinyness_before = numeric_limits<T>::tinyness_before;
510 static constexpr b2000::csda<T> min() {
return b2000::csda<T>(numeric_limits<T>::min()); }
512 static constexpr b2000::csda<T> lowest() {
return b2000::csda<T>(numeric_limits<T>::lowest()); }
514 static constexpr b2000::csda<T> max() {
return b2000::csda<T>(numeric_limits<T>::max()); }
516 static constexpr b2000::csda<T> epsilon() {
517 return b2000::csda<T>(numeric_limits<T>::epsilon());
520 static constexpr b2000::csda<T> round_error() {
521 return b2000::csda<T>(numeric_limits<T>::round_error());
524 static constexpr b2000::csda<T> infinity() {
525 return b2000::csda<T>(numeric_limits<T>::infinity());
528 static constexpr b2000::csda<T> quiet_NaN() {
529 return b2000::csda<T>(numeric_limits<T>::quiet_NaN());
532 static constexpr b2000::csda<T> signaling_NaN() {
533 return b2000::csda<T>(numeric_limits<T>::signaling_NaN());
536 static constexpr b2000::csda<T> denorm_min() {
537 return b2000::csda<T>(numeric_limits<T>::denorm_min());
542class std::numeric_limits<const
b2000::csda<T> > :
public std::numeric_limits<b2000::csda<T> > {};
545class std::numeric_limits<volatile
b2000::csda<T> > :
public std::numeric_limits<b2000::csda<T> > {
549class std::numeric_limits<const volatile
b2000::csda<T> >
550 :
public std::numeric_limits<b2000::csda<T> > {};
csda< T > acos(const csda< T > &z)
Arc cosine of a csda number.
Definition b2csda.H:431
csda< T > sinh(const csda< T > &a)
Hyperbolic sine of a csda number.
Definition b2csda.H:444
csda< T > sin(const csda< T > &a)
Sine of a csda number.
Definition b2csda.H:402
csda< T > log10(const csda< T > &a)
Common logarithm of a csda number.
Definition b2csda.H:372
csda< T > log(const csda< T > &a)
Natural logarithm of a csda number.
Definition b2csda.H:366
csda< T > exp(const csda< T > &a)
Natural exponential of a csda number.
Definition b2csda.H:360
csda< T > abs(const csda< T > &a)
Definition b2csda.H:335
csda< T > tan(const csda< T > &a)
Tangent of a csda number.
Definition b2csda.H:418
bool operator>=(const csda< T1 > &a, const csda< T2 > &b)
Comparison of two csda numbers is performed on the real part only.
Definition b2csda.H:316
csda< T > sqrt(const csda< T > &a)
Square root of a csda number.
Definition b2csda.H:396
csda< T > pow(const csda< T > &a, const csda< T > &b)
Power from two csda numbers.
Definition b2csda.H:378
csda< T > cosh(const csda< T > &a)
Hyperbolic cosine of a csda number.
Definition b2csda.H:450
bool operator<=(const csda< T1 > &a, const csda< T2 > &b)
Comparison of two csda numbers is performed on the real part only.
Definition b2csda.H:298
csda< T > atanh(const csda< T > &a)
Area hyperbolic tangent of a csda number.
Definition b2csda.H:474
csda< T > norm(const csda< T > &a)
Definition b2csda.H:343
csda< T > cos(const csda< T > &a)
Cosine of a csda number.
Definition b2csda.H:410
csda< T > asin(const csda< T > &z)
Arc sine of a csda number.
Definition b2csda.H:424
csda< T > acosh(const csda< T > &a)
Area hyperbolic cosine of a csda number.
Definition b2csda.H:468
bool operator==(const csda< T1 > &a, const csda< T2 > &b)
Comparison of two csda numbers is performed on the real part only.
Definition b2csda.H:226
csda< T > tanh(const csda< T > &a)
Tangent of a csda number.
Definition b2csda.H:456
bool operator>(const csda< T1 > &a, const csda< T2 > &b)
Comparison of two csda numbers is performed on the real part only.
Definition b2csda.H:280
csda< T > asinh(const csda< T > &a)
Area hyperbolic sine of a csda number.
Definition b2csda.H:462
bool operator!=(const csda< T1 > &a, const csda< T2 > &b)
Comparison of two csda numbers is performed on the real part only.
Definition b2csda.H:244
bool operator<(const csda< T1 > &a, const csda< T2 > &b)
Comparison of two csda numbers is performed on the real part only.
Definition b2csda.H:262
csda< T > conj(const csda< T > &a)
Returns the csda number rather than the std::complex conjugate.
Definition b2csda.H:349
csda< T > atan(const csda< T > &a)
Arc tangent of a csda number.
Definition b2csda.H:438
Contains the base classes for implementing Finite Elements.
Definition b2boundary_condition.H:32