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
Meta.Numerics.Complex Struct Reference

Represents a complex number. More...

+ Inheritance diagram for Meta.Numerics.Complex:
+ Collaboration diagram for Meta.Numerics.Complex:

Public Member Functions

 Complex (double re, double im)
 Initializes a new complex number. More...
 
override string ToString ()
 Produces a string representation of the complex number. More...
 
override bool Equals (object obj)
 Determines whether the given object represents the same complex number. More...
 
bool Equals (Complex other)
 Determines whether the given complex number is the same. More...
 
override int GetHashCode ()
 Returns a hash code for the complex number. More...
 

Static Public Member Functions

static operator double (Complex z)
 Converts the complex number to a double-precision real number. More...
 
static implicit operator Complex (double x)
 Converts a double-precision real number to a complex number. More...
 
static Complex operator- (Complex z)
 Negates a complex number. More...
 
static bool operator== (Complex z1, Complex z2)
 Tests the equality of two complex numbers. More...
 
static bool operator!= (Complex z1, Complex z2)
 Tests the inequality of two complex numbers. More...
 
static Complex operator+ (Complex z1, Complex z2)
 Adds two complex numbers. More...
 
static Complex operator- (Complex z1, Complex z2)
 Subtracts the second complex number from the first. More...
 
static Complex operator* (Complex z1, Complex z2)
 Multiplies two complex numbers. More...
 
static Complex operator/ (Complex z1, Complex z2)
 Divides two complex numbers. More...
 
static Complex operator* (double a, Complex z)
 Multiplies a complex number by a real number. More...
 
static Complex operator* (Complex z, double a)
 Multiplies a real number by a complex number. More...
 

Static Public Attributes

static readonly Complex Zero = new Complex(0.0, 0.0)
 Gets the complex value of zero. More...
 
static readonly Complex One = new Complex(1.0, 0.0)
 Gets the complex value of one. More...
 
static readonly Complex I = new Complex(0.0, 1.0)
 Gets the square root of negative one. More...
 

Properties

double Re [get]
 Gets the real part of the complex number. More...
 
double Im [get]
 Gets the imaginary part of the complex number. More...
 
Complex Conjugate [get]
 Gets the complex conjugate of the complex number. More...
 

Private Attributes

double re
 
double im
 

Detailed Description

Represents a complex number.

Version 4.0 of the .NET Framework introduced a Complex structure equivalent to this one. To maintain compatibility with earlier versions of the .NET Framework, Meta.Numerics maintains its own Complex structure.

Constructor & Destructor Documentation

Meta.Numerics.Complex.Complex ( double  re,
double  im 
)
inline

Initializes a new complex number.

Parameters
reThe real part of the complex number.
imThe imaginary part of the complex number.

Member Function Documentation

static Meta.Numerics.Complex.operator double ( Complex  z)
inlineexplicitstatic

Converts the complex number to a double-precision real number.

Parameters
zThe complex number to covert.
Returns
The corresponding double-precision real number.

This explicit cast will fail if the complex number has a non-zero imaginary part. If you just want to obtain the real part of a complex number, use the Re property.

Exceptions
InvalidCastExceptionz.Im ≠ 0

References Meta.Numerics.Complex.Im, and Meta.Numerics.Complex.Re.

static implicit Meta.Numerics.Complex.operator Complex ( double  x)
inlinestatic

Converts a double-precision real number to a complex number.

Parameters
xThe double-precision real number to convert.
Returns
The corresponding complex number.

The complex number output has a zero imaginary part and real part equal to the input number.

This is an implicit cast; the compiler will apply it automatically whenever a real number is given in a situation where a complex number is required.

override string Meta.Numerics.Complex.ToString ( )
inline

Produces a string representation of the complex number.

Returns
A string represenation of the complex number.
static Complex Meta.Numerics.Complex.operator- ( Complex  z)
inlinestatic

Negates a complex number.

Parameters
zThe argument.
Returns
The argument times -1.

References Meta.Numerics.Complex.im, and Meta.Numerics.Complex.re.

static bool Meta.Numerics.Complex.operator== ( Complex  z1,
Complex  z2 
)
inlinestatic

Tests the equality of two complex numbers.

Parameters
z1The first complex number.
z2The second complex number.
Returns
True if the two complex numbers are equal, otherwise false.

References Meta.Numerics.Complex.im, and Meta.Numerics.Complex.re.

static bool Meta.Numerics.Complex.operator!= ( Complex  z1,
Complex  z2 
)
inlinestatic

Tests the inequality of two complex numbers.

Parameters
z1The first complex number.
z2The second complex number.
Returns
False if the two complex numbers are equal, otherwise true.
override bool Meta.Numerics.Complex.Equals ( object  obj)
inline

Determines whether the given object represents the same complex number.

Parameters
objThe object to compare.
Returns
True if the object represents the same complex number, otherwise false.

Referenced by Test.ComplexTest.ComplexEquality(), and Test.ComplexTest.ComplexEquals().

bool Meta.Numerics.Complex.Equals ( Complex  other)
inline

Determines whether the given complex number is the same.

Parameters
otherThe complex number to compare.
Returns
True if the complex number is the same, otherwise false.
override int Meta.Numerics.Complex.GetHashCode ( )
inline

Returns a hash code for the complex number.

Returns
A hash code.

Referenced by Test.ComplexTest.ComplexEquality().

static Complex Meta.Numerics.Complex.operator+ ( Complex  z1,
Complex  z2 
)
inlinestatic

Adds two complex numbers.

Parameters
z1The first complex number.
z2The second complex number.
Returns
The sum of the complex numbers.

References Meta.Numerics.Complex.im, and Meta.Numerics.Complex.re.

static Complex Meta.Numerics.Complex.operator- ( Complex  z1,
Complex  z2 
)
inlinestatic

Subtracts the second complex number from the first.

Parameters
z1The first complex number.
z2The second complex number.
Returns
The difference of the complex numbers.

References Meta.Numerics.Complex.im, and Meta.Numerics.Complex.re.

static Complex Meta.Numerics.Complex.operator* ( Complex  z1,
Complex  z2 
)
inlinestatic

Multiplies two complex numbers.

Parameters
z1The first complex number.
z2The second complex number.
Returns
The product of the two complex numbers.

References Meta.Numerics.Complex.im, and Meta.Numerics.Complex.re.

static Complex Meta.Numerics.Complex.operator/ ( Complex  z1,
Complex  z2 
)
inlinestatic

Divides two complex numbers.

Parameters
z1The first complex number.
z2The second complex number.
Returns
The quotient of the two complex numbers.

References Meta.Numerics.Complex.Im, and Meta.Numerics.Complex.Re.

static Complex Meta.Numerics.Complex.operator* ( double  a,
Complex  z 
)
inlinestatic

Multiplies a complex number by a real number.

Parameters
aThe real number.
zThe complex number.
Returns
The product az.

References Meta.Numerics.Complex.im, and Meta.Numerics.Complex.re.

static Complex Meta.Numerics.Complex.operator* ( Complex  z,
double  a 
)
inlinestatic

Multiplies a real number by a complex number.

Parameters
zThe complex number.
aThe real number.
Returns
The product za.

Member Data Documentation

readonly Complex Meta.Numerics.Complex.Zero = new Complex(0.0, 0.0)
static

Gets the complex value of zero.

Referenced by Meta.Numerics.ComplexMath.Pow().

readonly Complex Meta.Numerics.Complex.I = new Complex(0.0, 1.0)
static

Gets the square root of negative one.

Referenced by Test.ComplexMathTest.ComplexIDefinition(), and Test.ComplexMathTest.ComplexIParts().

Property Documentation

double Meta.Numerics.Complex.Re
get

Gets the real part of the complex number.

Referenced by Meta.Numerics.ComplexMath.Abs(), Meta.Numerics.ComplexMath.Arg(), Meta.Numerics.Functions.AdvancedMath.Bessel_Steed(), Test.BugTests.Bug7208(), Test.ComplexTest.ComplexComponents(), Test.ComplexTest.ComplexConjugation(), Test.AdvancedComplexMathTest.ComplexDiLogBranchCut(), Test.AdvancedComplexMathTest.ComplexDiLogClausen(), Test.AdvancedComplexMathTest.ComplexErfFaddevaAgreement(), Test.AdvancedComplexMathTest.ComplexErfFresnel(), Test.ComplexTest.ComplexExplicitCast(), Test.ComplexMathTest.ComplexExpSumTest(), Test.AdvancedComplexMathTest.ComplexFaddeevaDawson(), Test.AdvancedComplexMathTest.ComplexGammaInequality(), Test.ComplexMathTest.ComplexIParts(), Test.AdvancedComplexMathTest.ComplexLogGammaConjugation(), Test.AdvancedComplexMathTest.ComplexReimannZetaPrimesTest(), Test.AdvancedComplexMathTest.ComplexRiemannZetaZeros(), Meta.Numerics.ComplexMath.Cos(), Meta.Numerics.ComplexMath.Cosh(), Meta.Numerics.Functions.AdvancedMath.Coulomb_Steed(), Meta.Numerics.Functions.AdvancedMath.Coulomb_Zero_Series(), Meta.Numerics.Functions.AdvancedComplexMath.DiLog(), Meta.Numerics.Matrices.SquareMatrix.Eigensystem(), Meta.Numerics.Functions.AdvancedComplexMath.Ein(), Meta.Numerics.Functions.AdvancedComplexMath.Erf(), Meta.Numerics.ComplexMath.Exp(), Meta.Numerics.Functions.AdvancedComplexMath.Gamma(), Meta.Numerics.Functions.AdvancedComplexMath.IsEinSeriesPrefered(), Meta.Numerics.Functions.AdvancedComplexMath.LogGamma(), Meta.Numerics.Functions.AdvancedComplexMath.LogGamma_Stirling(), Meta.Numerics.Complex.operator double(), Meta.Numerics.Complex.operator/(), Meta.Numerics.ComplexMath.Pow(), Meta.Numerics.Functions.AdvancedComplexMath.Psi(), Meta.Numerics.Functions.AdvancedComplexMath.RiemannZeta(), Meta.Numerics.ComplexMath.Sin(), Meta.Numerics.ComplexMath.Sinh(), Test.OrthogonalPolynomialsTest.SphericalHarmonicNormalization(), Meta.Numerics.ComplexMath.Sqrt(), Test.SquareMatrixTest.SquareVandermondeMatrixEigenvalues(), Meta.Numerics.ComplexMath.Tan(), and Meta.Numerics.ComplexMath.Tanh().

double Meta.Numerics.Complex.Im
get

Gets the imaginary part of the complex number.

Referenced by Meta.Numerics.ComplexMath.Abs(), Meta.Numerics.ComplexMath.Arg(), Meta.Numerics.Functions.AdvancedMath.Bessel_Steed(), Test.ComplexTest.ComplexComponents(), Test.ComplexTest.ComplexConjugation(), Test.AdvancedComplexMathTest.ComplexDiLogBranchCut(), Test.AdvancedComplexMathTest.ComplexDiLogClausen(), Test.ComplexMathTest.ComplexDoubleAngle(), Test.AdvancedComplexMathTest.ComplexErfFaddevaAgreement(), Test.AdvancedComplexMathTest.ComplexErfFresnel(), Test.AdvancedComplexMathTest.ComplexErfSymmetries(), Test.ComplexMathTest.ComplexExpSumTest(), Test.AdvancedComplexMathTest.ComplexFaddeevaConjugation(), Test.AdvancedComplexMathTest.ComplexFaddeevaDawson(), Test.ComplexMathTest.ComplexIParts(), Test.ComplexMathTest.ComplexNegativeAngles(), Test.AdvancedComplexMathTest.ComplexPsiImaginaryParts(), Test.ComplexMathTest.ComplexPythagorean(), Test.AdvancedComplexMathTest.ComplexRiemannZetaZeros(), Test.ComplexMathTest.ComplexSecTanTest(), Meta.Numerics.ComplexMath.Cos(), Meta.Numerics.ComplexMath.Cosh(), Meta.Numerics.Functions.AdvancedMath.Coulomb_Asymptotic(), Meta.Numerics.Functions.AdvancedMath.Coulomb_Steed(), Meta.Numerics.Functions.AdvancedComplexMath.DiLog(), Meta.Numerics.ComplexMath.Exp(), Meta.Numerics.Functions.AdvancedComplexMath.Faddeeva(), Meta.Numerics.Functions.AdvancedComplexMath.IsEinSeriesPrefered(), Meta.Numerics.Functions.AdvancedComplexMath.LogGamma_Stirling(), Meta.Numerics.Complex.operator double(), Meta.Numerics.Complex.operator/(), Meta.Numerics.ComplexMath.Pow(), Meta.Numerics.Functions.AdvancedComplexMath.RiemannZeta(), Meta.Numerics.ComplexMath.Sin(), Meta.Numerics.ComplexMath.Sinh(), Test.OrthogonalPolynomialsTest.SphericalHarmonicNormalization(), Meta.Numerics.ComplexMath.Sqrt(), Meta.Numerics.ComplexMath.Tan(), and Meta.Numerics.ComplexMath.Tanh().


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