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