NeurApp 1.1
NeurApp - software for exploring approximation by artificial neural networks on functions of one or two variables.
|
Complex number. More...
Public Member Functions | |
complex (double real) | |
Initializes a complex number with specified real part and imaginary part 0. | |
complex (double real, double imaginary) | |
Initializes a complex number with specified real and imaginary part. | |
complex (complex a) | |
Initializes a complex number with another complex number. | |
override int | GetHashCode () |
Overrides the GetHashCode() appropriately. | |
override bool | Equals (Object obj) |
Overrides the Equals() appropriately. | |
override string | ToString () |
Returns a string representation of the complec number in the form "(2.3+4.5*i)". | |
double | Absolute () |
Returns an absolute value of the complex number. | |
complex | Conjugate () |
Complex conjugate. | |
Static Public Member Functions | |
static bool | operator== (complex a, complex b) |
static bool | operator!= (complex a, complex b) |
static complex | operator+ (complex a, complex b) |
Binary operator + for summation of two complex numbers. | |
static complex | operator- (complex a, complex b) |
Binary operator - subtraction of two complex numbers. | |
static complex | operator- (complex a) |
Unary operator - changing sign of a complex number. | |
static complex | operator* (double a, complex c) |
Left multiplication of a complex number by a real number. | |
static complex | operator* (complex c, double a) |
Right multiplication of a complex number by a real number. | |
static complex | operator* (complex a, complex b) |
Complex multiplication. | |
static complex | operator/ (complex a, complex b) |
Complex division. | |
static implicit | operator complex (double number) |
Implicit conversion between from double to Complex. | |
static complex | Polar (double r, double fi) |
static double | Absolute (complex a) |
Returns an absolute value of the specified complex number. | |
static complex | Conjugate (complex a) |
Returns a complex conjugate of the argument. | |
static int | Compare (complex c1, complex c2) |
Compares two complex numbers and returns -1 if the first number is "smaller" than the second one, 0 if they are equal and 1 if the first number is "greater" than the second one. Comparison is artificial and does not have mathematical meaning. 0 is returned if and only if numbers are equal. | |
static void | Example () |
Example of using the complex class. | |
Public Attributes | |
double | _imaginary |
Properties | |
double | Re [get, set] |
Gets (public access) or sets (protected access) the real part of the complex number. | |
double | Im [get, set] |
Gets (public access) or sets (protected access) the imaginary part of the complex number. | |
double | SquaredAbs [get] |
Returns squared absolute value of the current complex number. | |
double | Abs [get] |
Gets modulus (absolute value) of the complex number. | |
double | Fi [get] |
Argument of the complex number. | |
static complex | Zero [get] |
Complex constant 0 + 0*i (summation unit) | |
static complex | One [get] |
Complex constant 1 + 0*i (multiplication unit). | |
static complex | I [get] |
Complex constant 1 + 0*i (summation unit) | |
double | this [int index] [get, set] |
Index operator - index 0 for real part and 1 for imaginary part of a complex number. | |
Private Attributes | |
double | _real |
Complex number.
$A Igor Sep08;
IG::Num::complex::complex | ( | double | real | ) | [inline] |
Initializes a complex number with specified real part and imaginary part 0.
real | Value assigned to the real part of the created complex number. |
imaginary | Value assigned to the imaginary part of the created complex number. |
IG::Num::complex::complex | ( | double | real, |
double | imaginary | ||
) | [inline] |
Initializes a complex number with specified real and imaginary part.
real | Value assigned to the real part of the created complex number. |
imaginary | Value assigned to the imaginary part of the created complex number. |
IG::Num::complex::complex | ( | complex | a | ) | [inline] |
Initializes a complex number with another complex number.
a | Complex number whose copy is created in this constructor. |
Binary operator + for summation of two complex numbers.
Binary operator - subtraction of two complex numbers.
Unary operator - changing sign of a complex number.
Left multiplication of a complex number by a real number.
Right multiplication of a complex number by a real number.
Complex multiplication.
Complex division.
static implicit IG::Num::complex::operator complex | ( | double | number | ) | [inline, static] |
Implicit conversion between from double to Complex.
number | Number that is converted. |
override int IG::Num::complex::GetHashCode | ( | ) | [inline] |
Overrides the GetHashCode() appropriately.
override bool IG::Num::complex::Equals | ( | Object | obj | ) | [inline] |
Overrides the Equals() appropriately.
static complex IG::Num::complex::Polar | ( | double | r, |
double | fi | ||
) | [inline, static] |
override string IG::Num::complex::ToString | ( | ) | [inline] |
Returns a string representation of the complec number in the form "(2.3+4.5*i)".
double IG::Num::complex::Absolute | ( | ) | [inline] |
Returns an absolute value of the complex number.
Implements IG::Num::IComplex.
static double IG::Num::complex::Absolute | ( | complex | a | ) | [inline, static] |
Returns an absolute value of the specified complex number.
a | Complex number whose absolute value is returned. |
complex IG::Num::complex::Conjugate | ( | ) | [inline] |
Complex conjugate.
Returns a complex conjugate of the argument.
Compares two complex numbers and returns -1 if the first number is "smaller" than the second one, 0 if they are equal and 1 if the first number is "greater" than the second one. Comparison is artificial and does not have mathematical meaning. 0 is returned if and only if numbers are equal.
c1 | First number to be compared. |
c2 | Second number to be compared. |
static void IG::Num::complex::Example | ( | ) | [inline, static] |
Example of using the complex class.
Complex class will be seldom used, usually the complex struct will be used instead (which is a value type).
double IG::Num::complex::_real [private] |
double IG::Num::complex::_imaginary |
double IG::Num::complex::Re [get, set] |
Gets (public access) or sets (protected access) the real part of the complex number.
Implements IG::Num::IComplex.
double IG::Num::complex::Im [get, set] |
Gets (public access) or sets (protected access) the imaginary part of the complex number.
Implements IG::Num::IComplex.
double IG::Num::complex::SquaredAbs [get] |
Returns squared absolute value of the current complex number.
Implements IG::Num::IComplex.
double IG::Num::complex::Abs [get] |
Gets modulus (absolute value) of the complex number.
Implements IG::Num::IComplex.
double IG::Num::complex::Fi [get] |
Argument of the complex number.
Implements IG::Num::IComplex.
complex IG::Num::complex::Zero [static, get] |
Complex constant 0 + 0*i (summation unit)
complex IG::Num::complex::One [static, get] |
Complex constant 1 + 0*i (multiplication unit).
complex IG::Num::complex::I [static, get] |
Complex constant 1 + 0*i (summation unit)
double IG::Num::complex::this [get, set] |
Index operator - index 0 for real part and 1 for imaginary part of a complex number.
Index operator where a string index defines what to get or to set. Possible indices read/write: re, Re, real, Real: real part of the complex number im, Im, imaginary, Imaginary: imaginary part of the complex number Possible indices - read only: r, R: modulus (absolute value) of the complex number fi, Fi: argument of the complex number.
index | Integer index that can be 0 (for real part of the complex number) or 1 (for imaginary part). |
index | String that defines what to get or to set. |