NeurApp 1.1
NeurApp - software for exploring approximation by artificial neural networks on functions of one or two variables.

IG::Num::complex Struct Reference

Complex number. More...

Inheritance diagram for IG::Num::complex:
Collaboration diagram for IG::Num::complex:

List of all members.

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

Detailed Description

Complex number.

$A Igor Sep08;


Constructor & Destructor Documentation

IG::Num::complex::complex ( double  real) [inline]

Initializes a complex number with specified real part and imaginary part 0.

Parameters:
realValue assigned to the real part of the created complex number.
imaginaryValue 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.

Parameters:
realValue assigned to the real part of the created complex number.
imaginaryValue 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.

Parameters:
aComplex number whose copy is created in this constructor.

Member Function Documentation

static bool IG::Num::complex::operator== ( complex  a,
complex  b 
) [inline, static]
static bool IG::Num::complex::operator!= ( complex  a,
complex  b 
) [inline, static]
static complex IG::Num::complex::operator+ ( complex  a,
complex  b 
) [inline, static]

Binary operator + for summation of two complex numbers.

static complex IG::Num::complex::operator- ( complex  a,
complex  b 
) [inline, static]

Binary operator - subtraction of two complex numbers.

static complex IG::Num::complex::operator- ( complex  a) [inline, static]

Unary operator - changing sign of a complex number.

static complex IG::Num::complex::operator* ( double  a,
complex  c 
) [inline, static]

Left multiplication of a complex number by a real number.

static complex IG::Num::complex::operator* ( complex  c,
double  a 
) [inline, static]

Right multiplication of a complex number by a real number.

static complex IG::Num::complex::operator* ( complex  a,
complex  b 
) [inline, static]

Complex multiplication.

static complex IG::Num::complex::operator/ ( complex  a,
complex  b 
) [inline, static]

Complex division.

static implicit IG::Num::complex::operator complex ( double  number) [inline, static]

Implicit conversion between from double to Complex.

Parameters:
numberNumber that is converted.
Returns:
Complex number that is a result of conversion from the specified number..
override int IG::Num::complex::GetHashCode ( ) [inline]

Overrides the GetHashCode() appropriately.

Returns:
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.

Parameters:
aComplex number whose absolute value is returned.
complex IG::Num::complex::Conjugate ( ) [inline]

Complex conjugate.

static complex IG::Num::complex::Conjugate ( complex  a) [inline, static]

Returns a complex conjugate of the argument.

static int IG::Num::complex::Compare ( complex  c1,
complex  c2 
) [inline, static]

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.

Parameters:
c1First number to be compared.
c2Second number to be compared.
Returns:
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).


Member Data Documentation

double IG::Num::complex::_real [private]

Property Documentation

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.

Parameters:
indexInteger index that can be 0 (for real part of the complex number) or 1 (for imaginary part).
Parameters:
indexString that defines what to get or to set.

The documentation for this struct was generated from the following file:
 All Classes Namespaces Files Functions Variables Enumerations Properties