IGLib  1.7.2
The IGLib base library EXTENDED - with other lilbraries and applications.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros
IG.Num.ComplexClass Class Reference

Class representing general complex numbers. More...

+ Inheritance diagram for IG.Num.ComplexClass:
+ Collaboration diagram for IG.Num.ComplexClass:

Public Member Functions

 ComplexClass ()
 Default (parameter-less) constructor, creates 0+0*i. More...
 
 ComplexClass (double real, double imaginary)
 Initializes a complex number with specified real and imaginary part. More...
 
 ComplexClass (complex a)
 Initializes a complex number with another complex number of type complex. More...
 
 ComplexClass (double a)
 Initializes a complex number with another complex number of type complex. More...
 
 ComplexClass (ComplexClass a)
 Initializes a complex number with another complex number. More...
 
override string ToString ()
 Returns a string representation of the complec number in the form "(2.3+4.5*i)". More...
 
double Absolute ()
 Returns an absolute value of the complex number. More...
 
ComplexClass Conjugate ()
 Complex conjugate. More...
 

Static Public Member Functions

static ComplexClass operator+ (ComplexClass a, ComplexClass b)
 Binary operator + for summation of two complex numbers. More...
 
static ComplexClass operator- (ComplexClass a, ComplexClass b)
 Binary operator - subtraction of two complex numbers. More...
 
static ComplexClass operator- (ComplexClass a)
 Unary operator - changing sign of a complex number. More...
 
static ComplexClass operator* (double a, ComplexClass c)
 Left multiplication of a complex number by a real number. More...
 
static ComplexClass operator* (ComplexClass c, double a)
 Right multiplication of a complex number by a real number. More...
 
static ComplexClass operator* (ComplexClass a, ComplexClass b)
 Complex multiplication. More...
 
static ComplexClass operator/ (ComplexClass a, ComplexClass b)
 Complex division. More...
 
static implicit operator ComplexClass (double number)
 Implicit conversion from double to Complex. More...
 
static implicit operator ComplexClass (complex complexStruct)
 Implicit conversion from complex (struct) to Complex. More...
 
static ComplexClass Polar (double r, double fi)
 
static double Absolute (ComplexClass a)
 Returns an absolute value of the specified complex number. More...
 
static ComplexClass Conjugate (ComplexClass a)
 Returns a complex conjugate of the argument. More...
 
static void Example ()
 Example of using the complex class. More...
 

Properties

complex Base [get]
 Returns a struct of type complex that represents the same complex number as the current class. More...
 
virtual double Re [get, protected set]
 Gets (public access) or sets (protected access) the real part of the complex number. More...
 
virtual double Im [get, protected set]
 Gets (public access) or sets (protected access) the imaginary part of the complex number. More...
 
double SquaredAbs [get]
 Returns squared absolute value of the current complex number. More...
 
virtual double Abs [get]
 Gets modulus (absolute value) of the complex number. More...
 
virtual double Fi [get]
 Argument of the complex number. More...
 
static ComplexClass Zero [get]
 Complex constant 0 + 0*i (summation unit) More...
 
static ComplexClass One [get]
 Complex constant 1 + 0*i (multiplication unit). More...
 
static ComplexClass I [get]
 Complex constant 1 + 0*i (summation unit) More...
 
double this[int index] [get, set]
 Index operator - index 0 for real part and 1 for imaginary part of a complex number. More...
 
double this[string index] [get, set]
 Index operator where a string index defines what to get or to set. More...
 
- Properties inherited from IG.Num.IComplex
double Re [get]
 Real part of the current complex number. More...
 
double Im [get]
 Imaginary part of the current complex number. More...
 
double SquaredAbs [get]
 Returns squared absolute value of the current complex number. More...
 
double Abs [get]
 Modulus (absolute value) of the current complex number. More...
 
double Fi [get]
 Argument of the current complex number. More...
 

Private Attributes

complex _base
 

Static Private Attributes

static ComplexClass _zero = null
 
static ComplexClass _one = null
 
static ComplexClass _i = null
 

Detailed Description

Class representing general complex numbers.

$A Igor Apr09 Mar11;

Constructor & Destructor Documentation

IG.Num.ComplexClass.ComplexClass ( )
inline

Default (parameter-less) constructor, creates 0+0*i.

IG.Num.ComplexClass.ComplexClass ( 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.ComplexClass.ComplexClass ( complex  a)
inline

Initializes a complex number with another complex number of type complex.

Parameters
aComplex number whose copy is created in this constructor.
IG.Num.ComplexClass.ComplexClass ( double  a)
inline

Initializes a complex number with another complex number of type complex.

Parameters
aComplex number whose copy is created in this constructor.
IG.Num.ComplexClass.ComplexClass ( ComplexClass  a)
inline

Initializes a complex number with another complex number.

Parameters
aComplex number whose copy is created in this constructor.

References IG.Num.ComplexClass.Im, and IG.Num.ComplexClass.Re.

Member Function Documentation

static ComplexClass IG.Num.ComplexClass.operator+ ( ComplexClass  a,
ComplexClass  b 
)
inlinestatic

Binary operator + for summation of two complex numbers.

References IG.Num.ComplexClass._base.

static ComplexClass IG.Num.ComplexClass.operator- ( ComplexClass  a,
ComplexClass  b 
)
inlinestatic

Binary operator - subtraction of two complex numbers.

References IG.Num.ComplexClass._base.

static ComplexClass IG.Num.ComplexClass.operator- ( ComplexClass  a)
inlinestatic

Unary operator - changing sign of a complex number.

References IG.Num.ComplexClass._base.

static ComplexClass IG.Num.ComplexClass.operator* ( double  a,
ComplexClass  c 
)
inlinestatic

Left multiplication of a complex number by a real number.

References IG.Num.ComplexClass._base.

static ComplexClass IG.Num.ComplexClass.operator* ( ComplexClass  c,
double  a 
)
inlinestatic

Right multiplication of a complex number by a real number.

References IG.Num.ComplexClass._base.

static ComplexClass IG.Num.ComplexClass.operator* ( ComplexClass  a,
ComplexClass  b 
)
inlinestatic

Complex multiplication.

References IG.Num.ComplexClass._base.

static ComplexClass IG.Num.ComplexClass.operator/ ( ComplexClass  a,
ComplexClass  b 
)
inlinestatic

Complex division.

References IG.Num.ComplexClass._base.

static implicit IG.Num.ComplexClass.operator ComplexClass ( double  number)
inlinestatic

Implicit conversion from double to Complex.

Parameters
numberNumber that is converted.
Returns
Complex number that is a result of conversion from the specified number..
static implicit IG.Num.ComplexClass.operator ComplexClass ( complex  complexStruct)
inlinestatic

Implicit conversion from complex (struct) to Complex.

Parameters
numberNumber that is converted.
Returns
Complex number that is a result of conversion from the specified number..
static ComplexClass IG.Num.ComplexClass.Polar ( double  r,
double  fi 
)
inlinestatic
override string IG.Num.ComplexClass.ToString ( )
inline

Returns a string representation of the complec number in the form "(2.3+4.5*i)".

References IG.Num.complex.ToString().

Referenced by IG.Num.ComplexClass.Example().

double IG.Num.ComplexClass.Absolute ( )
inline

Returns an absolute value of the complex number.

Implements IG.Num.IComplex.

References IG.Num.complex.Abs.

static double IG.Num.ComplexClass.Absolute ( ComplexClass  a)
inlinestatic

Returns an absolute value of the specified complex number.

Parameters
aComplex number whose absolute value is returned.

References IG.Num.ComplexClass._base, and IG.Num.complex.Absolute().

ComplexClass IG.Num.ComplexClass.Conjugate ( )
inline

Complex conjugate.

References IG.Num.complex.Conjugate().

Referenced by IG.Num.ComplexClass.Example().

static ComplexClass IG.Num.ComplexClass.Conjugate ( ComplexClass  a)
inlinestatic

Returns a complex conjugate of the argument.

References IG.Num.ComplexClass._base, and IG.Num.complex.Conjugate().

static void IG.Num.ComplexClass.Example ( )
inlinestatic

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).

References IG.Num.ComplexClass.Conjugate(), IG.Num.ComplexClass.ToString(), and IG.Num.ComplexRealClass.ToString().

Member Data Documentation

ComplexClass IG.Num.ComplexClass._zero = null
staticprivate
ComplexClass IG.Num.ComplexClass._one = null
staticprivate
ComplexClass IG.Num.ComplexClass._i = null
staticprivate

Property Documentation

complex IG.Num.ComplexClass.Base
get

Returns a struct of type complex that represents the same complex number as the current class.

virtual double IG.Num.ComplexClass.Re
getprotected set

Gets (public access) or sets (protected access) the real part of the complex number.

Referenced by IG.Num.ComplexClass.ComplexClass(), IG.Num.ComplexRealClass.ComplexRealClass(), and IG.Num.complex.Equals().

virtual double IG.Num.ComplexClass.Im
getprotected set

Gets (public access) or sets (protected access) the imaginary part of the complex number.

Referenced by IG.Num.ComplexClass.ComplexClass(), IG.Num.ComplexRealClass.ComplexRealClass(), and IG.Num.complex.Equals().

double IG.Num.ComplexClass.SquaredAbs
get

Returns squared absolute value of the current complex number.

virtual double IG.Num.ComplexClass.Abs
get

Gets modulus (absolute value) of the complex number.

virtual double IG.Num.ComplexClass.Fi
get

Argument of the complex number.

ComplexClass IG.Num.ComplexClass.Zero
staticget

Complex constant 0 + 0*i (summation unit)

ComplexClass IG.Num.ComplexClass.One
staticget

Complex constant 1 + 0*i (multiplication unit).

ComplexClass IG.Num.ComplexClass.I
staticget

Complex constant 1 + 0*i (summation unit)

double IG.Num.ComplexClass.this[int index]
getset

Index operator - index 0 for real part and 1 for imaginary part of a complex number.

Parameters
indexInteger index that can be 0 (for real part of the complex number) or 1 (for imaginary part).
double IG.Num.ComplexClass.this[string index]
getset

Index operator where a string index defines what to get or to set.

For information about possible values of index, see struct complex.

Parameters
indexString that defines what to get or to set.

Possible indices read/write (for precise informatin, see struct complex): 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


The documentation for this class was generated from the following file: