CGAL 6.0 - 2D Hyperbolic Surface Triangulations
Loading...
Searching...
No Matches
ComplexNumber Concept Reference

Definition

Describes a complex number type over a FieldNumberType for its real and imaginary parts.

Refines
Field
Has models
CGAL::Complex_number

Types

typedef unspecified_type FT
 Number type for real and imaginary parts: must be a model of FieldNumberType.
 

Creation

 ComplexNumber ()
 Default constructor, sets the both the real part and the imaginary part to \( 0 \).
 
 ComplexNumber (const FT &real_part)
 Constructor, sets the real part to real_part and the imaginary part to \( 0 \).
 
 ComplexNumber (const FT &real_part, const FT &imaginary_part)
 Constructor, sets the real part to real_part and the imaginary part to imaginary_part .
 
template<class U , class V >
 ComplexNumber (U &&real_part, V &&imaginary_part)
 Constructor, sets the real part to real_part and the imaginary part to imaginary_part .
 

Get and Set

void real (const FT &real_part)
 sets the real part to real_part .
 
void imag (const FT &imaginary_part)
 sets the imaginary part to imaginary_part .
 
FT real () const
 returns the real part.
 
FT imag () const
 returns the imaginary part.
 

Operations

ComplexNumber operator+ (const ComplexNumber &z) const
 returns +z.
 
ComplexNumber operator- (const ComplexNumber &z) const
 returns -z.
 
ComplexNumber operator+= (const ComplexNumber &other) const
 Unary complex addition.
 
ComplexNumber operator-= (const ComplexNumber &other) const
 Unary complex substraction.
 
ComplexNumber operator*= (const ComplexNumber &other) const
 Unary complex multiplication.
 
ComplexNumber operator/= (const ComplexNumber &other) const
 Unary complex division.
 
ComplexNumber operator= (const ComplexNumber &other) const
 Copy operator.
 
bool operator== (const ComplexNumber &z1, const ComplexNumber &z2)
 Equality test.
 
bool operator!= (const ComplexNumber &z1, const ComplexNumber &z2)
 Inequality test.
 
ComplexNumber operator+ (const ComplexNumber &z1, const ComplexNumber &z2)
 Binary complex addition.
 
ComplexNumber operator- (const ComplexNumber &z1, const ComplexNumber &z2)
 Binary complex substraction.
 
ComplexNumber operator* (const ComplexNumber &z1, const ComplexNumber &z2)
 Binary complex multiplication.
 
ComplexNumber operator/ (const ComplexNumber &z1, const ComplexNumber &z2)
 Binary complex division.
 
std::ostream & operator<< (std::ostream &s, const ComplexNumber &z)
 writes the complex in a stream.
 
void operator>> (std::istream &s, ComplexNumber &z)
 reads the complex from a stream.
 
FT norm (ComplexNumber z) const
 returns the square of the modulus.
 
ComplexNumber conj (ComplexNumber z) const
 returns the conjugate.