SourcePro C++ 12.0 |
SourcePro® C++ API Reference Guide |
SourcePro C++ Documentation Home |
Complex class for compilers that do not have access to a native complex class. More...
#include <rw/rcomplex.h>
Public Member Functions | |
DComplex () | |
DComplex (double r) | |
DComplex (double r, double i) | |
void | operator+= (const DComplex &a) |
void | operator-= (const DComplex &a) |
void | operator*= (const DComplex &a) |
void | operator/= (const DComplex &a) |
Friends | |
int | operator== (const DComplex &a, const DComplex &b) |
int | operator!= (const DComplex &a, const DComplex &b) |
std::ostream & | operator<< (std::ostream &s, const DComplex &a) |
std::istream & | operator>> (std::istream &s, DComplex &a) |
Related Functions | |
(Note that these are not member functions.) | |
double | real (const DComplex &a) |
double | imag (const DComplex &a) |
double | abs (const DComplex &a) |
double | norm (const DComplex &a) |
double | arg (const DComplex &a) |
DComplex | conj (const DComplex &a) |
DComplex | cos (const DComplex &a) |
DComplex | cosh (const DComplex &a) |
DComplex | exp (const DComplex &a) |
DComplex | log (const DComplex &a) |
DComplex | pow (double x, const DComplex &y) |
DComplex | pow (const DComplex &x, int y) |
DComplex | pow (const DComplex &x, double y) |
DComplex | pow (const DComplex &x, const DComplex &y) |
DComplex | polar (double r, double t=0) |
DComplex | sin (const DComplex &a) |
DComplex | sinh (const DComplex &a) |
DComplex | sqrt (const DComplex &a) |
DComplex | operator+ (const DComplex &a1, const DComplex &a2) |
DComplex | operator+ (double s, const DComplex &a2) |
DComplex | operator+ (const DComplex &a1, double s) |
DComplex | operator- (const DComplex &a) |
DComplex | operator- (const DComplex &a1, const DComplex &a2) |
DComplex | operator- (double s, const DComplex &a2) |
DComplex | operator- (const DComplex &a1, double s) |
DComplex | operator* (const DComplex &a1, const DComplex &a2) |
DComplex | operator* (const DComplex &a1, double s) |
DComplex | operator* (double s, const DComplex &a1) |
DComplex | operator/ (const DComplex &a1, const DComplex &a2) |
DComplex | operator/ (const DComplex &a1, double s) |
DComplex | operator/ (double s, const DComplex &a1) |
#include <rw/dcomplex.h> DComplex a;
DComplex::DComplex | ( | ) | [inline] |
Unadorned constructor. The real and imaginary parts are initialized to 0.
DComplex::DComplex | ( | double | r | ) | [inline] |
Constructs a complex number with real part equal to r and imaginary part equal to 0
.
DComplex::DComplex | ( | double | r, | |
double | i | |||
) | [inline] |
Constructs a complex number with real part equal to r and imaginary part equal to i.
void DComplex::operator*= | ( | const DComplex & | a | ) |
void DComplex::operator+= | ( | const DComplex & | a | ) | [inline] |
void DComplex::operator-= | ( | const DComplex & | a | ) | [inline] |
void DComplex::operator/= | ( | const DComplex & | a | ) |
double abs | ( | const DComplex & | a | ) | [friend] |
double arg | ( | const DComplex & | a | ) | [friend] |
Returns the argument in radians of a complex number as a double precision number.
double imag | ( | const DComplex & | a | ) | [friend] |
Returns the imaginary part of a complex number as a double precision number.
Return the principal value of the logarithm of a complex number.
double norm | ( | const DComplex & | a | ) | [friend] |
Tests for inequality. For operator!=() to return 1, either a.real() == b.real()
or a.imag() == b.imag()
must be false
.
Returns the product of a1 and a2.
Returns the sum of a1 and a2.
Returns the difference of a1 and a2.
Returns the quotient of a1 and a2.
std::ostream& operator<< | ( | std::ostream & | s, | |
const DComplex & | a | |||
) | [friend] |
Writes a complex number a to std::ostream s in the form:
( Re(a), Im(a) )
Tests for equality. For operator==() to return 1, both a.real() == b.real()
and a.imag() == b.imag()
must be true
.
std::istream& operator>> | ( | std::istream & | s, | |
DComplex & | a | |||
) | [friend] |
Reads a complex number from std::istream s in any of the following forms:
u
( u )
or:
( u, v )
where u
is the real part and v
is the imaginary part of the number.
DComplex polar | ( | double | r, | |
double | t = 0 | |||
) | [friend] |
For arguments r and t, where complex number a = reit
, returns a complex number in Cartesian form.
double real | ( | const DComplex & | a | ) | [friend] |
Returns the real part of a complex number as a double precision number.
© Copyright Rogue Wave Software, Inc. All Rights Reserved.
Rogue Wave and SourcePro are registered trademarks of Rogue Wave Software, Inc. in the United States and other countries. All other trademarks are the property of their respective owners.
Contact Rogue Wave about documentation or support issues.