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 &)
throw();
153 (
const real &,
const l_complex &)
throw();
161 (
const l_real &,
const l_complex &)
throw();
169 (
const l_real &,
const l_complex &)
throw();
177 (
const complex &,
const l_complex &)
throw();
185 (
const real &,
const l_complex &)
throw();
189 friend cdotprecision
operator+
190 (
const l_complex &,
const cdotprecision &)
throw();
193 friend cdotprecision
operator+
194 (
const cdotprecision &,
const l_complex &)
throw();
198 friend cdotprecision
operator-
199 (
const l_complex &,
const cdotprecision &)
throw();
202 friend cdotprecision
operator-
203 (
const cdotprecision &,
const l_complex &)
throw();
207 friend cdotprecision
operator+
208 (
const l_complex &,
const dotprecision &)
throw();
211 friend cdotprecision
operator+
212 (
const dotprecision &,
const l_complex &)
throw();
216 friend cdotprecision
operator-
217 (
const l_complex &,
const dotprecision &)
throw();
220 friend cdotprecision
operator-
221 (
const dotprecision &,
const l_complex &)
throw();
246 (
const real &,
const l_complex &)
throw();
254 (
const l_real &,
const l_complex &)
throw();
286 const complex&)
throw();
290 const real&)
throw();
294 const l_real&)
throw();
298 friend inline cdotprecision &
operator += (cdotprecision &cd,
301 friend inline cdotprecision &
operator -= (cdotprecision &cd,
333 friend inline bool operator! (
const l_complex &)
throw();
403 const complex & b)
throw();
406 const l_real & b)
throw();
409 const real & b)
throw();
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)
throw()
512 {
return l_complex(a); }
513 inline l_complex _l_complex(
const l_real &a,
const l_real &b)
514 throw() {
return l_complex(a,b); }
515 inline l_complex _l_complex(
const real &a)
throw()
516 {
return l_complex(a); }
517 inline l_complex _l_complex(
const real &a,
const real &b)
518 throw() {
return l_complex(a,b); }
519 inline l_complex _l_complex(
const complex &c)
520 throw() {
return l_complex(c); }
521 inline l_complex _l_complex(
const dotprecision &d)
522 throw() {
return l_complex(d); }
523 inline l_complex conj(
const l_complex&)
throw();
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 &)
throw();
543 #include "l_complex.inl"
545 #endif // _CXSC_L_COMPLEX_HPP_INCLUDED
l_complex(const dotprecision &d)
Constructor of class l_complex.
friend l_real abs(const l_complex &z)
The absolute value of a l_complex value.
l_complex _l_complex(const cdotprecision &)
Deprecated typecast, which only exist for the reason of compatibility with older versions of C-XSC.
friend bool operator!=(const l_complex &, const l_complex &)
Implementation of standard negated equality operation.
l_complex(const complex &r)
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 void accumulate(cdotprecision &, const l_complex &, const l_complex &)
The accurate scalar product of the last two arguments added to the value of the first argument.
friend std::istream & operator>>(std::istream &s, l_complex &a)
Implementation of standard input method.
friend cdotprecision & operator+=(cdotprecision &cd, const l_complex &lc)
Implementation of standard algebraic addition and allocation operation.
l_complex(void)
Constructor of class l_complex.
friend l_complex & operator/=(l_complex &, const l_complex &)
Implementation of standard algebraic division and allocation operation.
friend l_real abs2(const l_complex &a)
The absolute value of a l_complex value.
l_complex(const l_real &a, const l_real &b)
Constructor of class l_complex.
friend int StagPrec(const l_complex &)
Returns the precision of the long datatype value.
l_complex & operator=(const l_real &lr)
Implementation of standard assigning operator.
friend l_complex operator-(const l_complex &)
Implementation of standard algebraic negative sign operation.
The Multiple-Precision Data Type l_complex.
friend std::ostream & operator<<(std::ostream &s, const l_complex &z)
Implementation of standard output method.
l_complex(const cdotprecision &cd)
Constructor of class l_complex.
The Data Type dotprecision.
friend l_complex operator*(const l_complex &a, const l_complex &b)
Implementation of standard algebraic multiplication operation.
friend l_real & Im(l_complex &a)
Returns the imaginary part of the complex value.
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.
l_complex(const l_real &r)
Constructor of class l_complex.
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.
l_complex(const real &a, const real &b)
Constructor of class l_complex.
The Data Type cdotprecision.
friend l_complex & SetIm(l_complex &a, const l_real &b)
Sets the imaginary part of a complex value.
l_complex(const real &r)
Constructor of class l_complex.
friend l_complex conj(const l_complex &)
Returns the conjugated complex value.
friend bool operator==(const l_complex &, const l_complex &)
Implementation of standard equality operation.
friend l_complex operator/(const l_complex &, const l_complex &)
Implementation of standard algebraic division operation.
friend l_complex & operator*=(l_complex &, const l_complex &)
Implementation of standard algebraic multiplication and allocation operation.
friend cdotprecision & operator-=(cdotprecision &cd, const l_complex &lc)
Implementation of standard algebraic subtraction and allocation operation.