CGAL 6.1 - 2D Triangulations on Hyperbolic Surfaces
Loading...
Searching...
No Matches

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 .
 

Getter and Setter

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 &other) const
 Copy operator.
 
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.
 

Constructor & Destructor Documentation

◆ ComplexNumber()

template<class U , class V >
ComplexNumber::ComplexNumber ( U &&  real_part,
V &&  imaginary_part 
)

Constructor, sets the real part to real_part and the imaginary part to imaginary_part .

FT must be constructible from U and V.