C-XSC - A C++ Class Library for Extended Scientific Computing
2.5.4
|
25 #ifndef _CXSC_L_COMPLEX_HPP_INCLUDED
26 #define _CXSC_L_COMPLEX_HPP_INCLUDED
32 #include "complex.hpp"
34 #include "l_rmath.hpp"
64 { re = lr; im = 0;
return *
this; }
67 { re = r; im = 0;
return *
this; }
70 { re =
Re(c); im =
Im(c);
return *
this; }
73 { re = d; im = 0.0;
return *
this; }
145 (
const complex &,
const l_complex &) noexcept;
153 (
const real &,
const l_complex &) noexcept;
161 (
const l_real &,
const l_complex &) noexcept;
169 (
const l_real &,
const l_complex &) noexcept;
177 (
const complex &,
const l_complex &) noexcept;
185 (
const real &,
const l_complex &) noexcept;
189 friend cdotprecision
operator+
190 (
const l_complex &,
const cdotprecision &) noexcept;
193 friend cdotprecision
operator+
194 (
const cdotprecision &,
const l_complex &) noexcept;
198 friend cdotprecision
operator-
199 (
const l_complex &,
const cdotprecision &) noexcept;
202 friend cdotprecision
operator-
203 (
const cdotprecision &,
const l_complex &) noexcept;
207 friend cdotprecision
operator+
208 (
const l_complex &,
const dotprecision &) noexcept;
211 friend cdotprecision
operator+
212 (
const dotprecision &,
const l_complex &) noexcept;
216 friend cdotprecision
operator-
217 (
const l_complex &,
const dotprecision &) noexcept;
220 friend cdotprecision
operator-
221 (
const dotprecision &,
const l_complex &) noexcept;
246 (
const real &,
const l_complex &) noexcept;
254 (
const l_real &,
const l_complex &) noexcept;
286 const complex&) noexcept;
290 const real&) noexcept;
294 const l_real&) noexcept;
298 friend inline cdotprecision &
operator += (cdotprecision &cd,
301 friend inline cdotprecision &
operator -= (cdotprecision &cd,
333 friend inline bool operator! (
const l_complex &) noexcept;
403 const complex & b) noexcept;
406 const l_real & b) noexcept;
409 const real & b) noexcept;
470 skipeolnflag = inpdotflag =
true;
471 c = skipwhitespacessinglechar (s,
'(');
477 skipeolnflag = inpdotflag =
true;
478 c = skipwhitespacessinglechar (s,
',');
479 if (inpdotflag) s.putback(c);
481 s >> a.im >> RestoreOpt;
485 skipeolnflag =
false, inpdotflag =
true;
486 c = skipwhitespaces (s);
487 if (inpdotflag && c !=
')')
498 s = skipwhitespacessinglechar (s,
'(');
499 s >> SaveOpt >> a.re;
500 s = skipwhitespacessinglechar (s,
',');
501 s >> a.im >> RestoreOpt;
502 s = skipwhitespaces (s);
511 inline l_complex _l_complex(
const l_real &a) noexcept
512 {
return l_complex(a); }
513 inline l_complex _l_complex(
const l_real &a,
const l_real &b)
514 noexcept {
return l_complex(a,b); }
515 inline l_complex _l_complex(
const real &a) noexcept
516 {
return l_complex(a); }
517 inline l_complex _l_complex(
const real &a,
const real &b)
518 noexcept {
return l_complex(a,b); }
519 inline l_complex _l_complex(
const complex &c)
520 noexcept {
return l_complex(c); }
521 inline l_complex _l_complex(
const dotprecision &d)
522 noexcept {
return l_complex(d); }
523 inline l_complex conj(
const l_complex&) noexcept;
527 l_real & Re(l_complex& a);
528 l_real Re(
const l_complex& a);
529 l_real & Im(l_complex& a);
530 l_real Im(
const l_complex& a);
532 l_complex & SetRe(l_complex & a,
const l_real & b);
536 l_complex & SetIm(l_complex & a,
const l_real & b);
539 l_complex _l_complex(
const cdotprecision &) noexcept;
543 #include "l_complex.inl"
545 #endif // _CXSC_L_COMPLEX_HPP_INCLUDED
l_complex _l_complex(const cdotprecision &)
Deprecated typecast, which only exist for the reason of compatibility with older versions of C-XSC.
l_complex(const complex &r) noexcept
Constructor of class l_complex.
friend std::ostream & operator<<(std::ostream &s, const l_complex &z) noexcept
Implementation of standard output method.
l_complex(const dotprecision &d) noexcept
Constructor of class l_complex.
l_complex(const real &a, const real &b) noexcept
Constructor of class l_complex.
friend l_real & Re(l_complex &a)
Returns the real part of the complex value.
friend l_complex operator+(const l_complex &)
Implementation of standard algebraic positive sign operation.
friend l_complex operator/(const l_complex &, const l_complex &) noexcept
Implementation of standard algebraic division operation.
friend l_real abs2(const l_complex &a) noexcept
The absolute value of a l_complex value.
friend bool operator!=(const l_complex &, const l_complex &) noexcept
Implementation of standard negated equality operation.
friend l_complex & operator/=(l_complex &, const l_complex &) noexcept
Implementation of standard algebraic division and allocation operation.
friend bool operator==(const l_complex &, const l_complex &) noexcept
Implementation of standard equality operation.
friend std::istream & operator>>(std::istream &s, l_complex &a) noexcept
Implementation of standard input method.
l_complex(const l_real &r) noexcept
Constructor of class l_complex.
l_complex(const real &r) noexcept
Constructor of class l_complex.
friend l_complex operator-(const l_complex &)
Implementation of standard algebraic negative sign operation.
The Multiple-Precision Data Type l_complex.
The Data Type dotprecision.
l_complex(const cdotprecision &cd) noexcept
Constructor of class l_complex.
friend l_real abs(const l_complex &z) noexcept
The absolute value of a l_complex value.
l_complex(const l_real &a, const l_real &b) noexcept
Constructor of class l_complex.
friend l_real & Im(l_complex &a)
Returns the imaginary part of the complex value.
l_complex & operator=(const l_real &lr) noexcept
Implementation of standard assigning operator.
friend l_complex & operator*=(l_complex &, const l_complex &) noexcept
Implementation of standard algebraic multiplication and allocation operation.
The namespace cxsc, providing all functionality of the class library C-XSC.
friend l_complex divn(const l_complex &, const l_complex &)
Division of two real values and rounding to the nearest value.
The Multiple-Precision Data Type l_real.
friend l_complex & SetRe(l_complex &a, const l_real &b)
Sets the real part of a complex value.
The Data Type cdotprecision.
friend int StagPrec(const l_complex &) noexcept
Returns the precision of the long datatype value.
friend l_complex & SetIm(l_complex &a, const l_real &b)
Sets the imaginary part of a complex value.
l_complex(void) noexcept
Constructor of class l_complex.
friend cdotprecision & operator+=(cdotprecision &cd, const l_complex &lc) noexcept
Implementation of standard algebraic addition and allocation operation.
friend cdotprecision & operator-=(cdotprecision &cd, const l_complex &lc) noexcept
Implementation of standard algebraic subtraction and allocation operation.
friend l_complex operator*(const l_complex &a, const l_complex &b) noexcept
Implementation of standard algebraic multiplication operation.
friend void accumulate(cdotprecision &, const l_complex &, const l_complex &) noexcept
The accurate scalar product of the last two arguments added to the value of the first argument.
friend l_complex conj(const l_complex &) noexcept
Returns the conjugated complex value.