Template class Komplex with concepts
Komplex< T > Class Template Reference

#include <komplex.h>

Public Member Functions

 Komplex ()
 
 Komplex (T re, T im=0.0)
 
 Komplex (const Komplex< T > &org)=default
 
 Komplex (Komplex< T > &&org)=default
 
Komplex< T > & operator= (const Komplex< T > &rhs)=default
 
Komplex< T > & operator= (Komplex< T > &&rhs)=default
 
 ~Komplex ()=default
 
Get_re () const
 
void Set_re (T val)
 
Get_im () const
 
void Set_im (T val)
 
Komplex< T > & operator+= (const Komplex< T > &rhs)
 
Komplex< T > operator+ (const Komplex< T > &rhs) const
 
bool operator< (const Komplex< T > &rhs) const
 
bool operator== (const Komplex< T > &rhs) const
 
bool operator> (const Komplex< T > &rhs) const
 
 Komplex ()
 
 Komplex (T re, T im=0.0)
 
 Komplex (const Komplex< T > &org)=default
 
 Komplex (Komplex< T > &&org)=default
 
Komplex< T > & operator= (const Komplex< T > &rhs)=default
 
Komplex< T > & operator= (Komplex< T > &&rhs)=default
 
 ~Komplex ()=default
 
Get_re () const
 
void Set_re (T val)
 
Get_im () const
 
void Set_im (T val)
 
Komplex< T > & operator+= (const Komplex< T > &rhs)
 
Komplex< T > operator+ (const Komplex< T > &rhs) const
 
bool operator< (const Komplex< T > &rhs) const
 
bool operator== (const Komplex< T > &rhs) const
 
bool operator> (const Komplex< T > &rhs) const
 

Friends

template<class S >
std::ostream & operator<< (std::ostream &s, const Komplex< S > &rhs)
 
template<class S >
std::ostream & operator<< (std::ostream &s, const Komplex< S > &rhs)
 

Detailed Description

template<typename T>
class Komplex< T >

Template Klasse fuer komplexe Zahlen zur Demonstration.

Template Parameters
Tfloating point type
Warning
Bei Templateklassen (und -funktionen) muss der Implementierungsteil, hier im File komplex.tpp, im Headerfile inkludiert werden. Das Implementierungsfile darf nicht noch einmal ueberstzt werden!

Definition at line 18 of file komplex.h.

Constructor & Destructor Documentation

◆ Komplex() [1/8]

template<typename T >
Komplex< T >::Komplex ( )
inline

Default constructor initializes both components by zero.

Definition at line 22 of file komplex.h.

◆ Komplex() [2/8]

template<typename T >
Komplex< T >::Komplex ( re,
im = 0.0 
)
inline

Parameter constructor

Parameters
[in]reRealteil
[in]imImaginaerteil (default value: 0.0)

Definition at line 29 of file komplex.h.

◆ Komplex() [3/8]

template<typename T >
Komplex< T >::Komplex ( const Komplex< T > &  org)
default

◆ Komplex() [4/8]

template<typename T >
Komplex< T >::Komplex ( Komplex< T > &&  org)
default

◆ ~Komplex() [1/2]

template<typename T >
Komplex< T >::~Komplex ( )
default

◆ Komplex() [5/8]

template<typename T >
Komplex< T >::Komplex ( )
inline

Default constructor initializes both components by zero.

Definition at line 25 of file komplex2.h.

◆ Komplex() [6/8]

template<typename T >
Komplex< T >::Komplex ( re,
im = 0.0 
)
inline

Parameter constructor

Parameters
[in]reRealteil
[in]imImaginaerteil (default value: 0.0)

Definition at line 32 of file komplex2.h.

◆ Komplex() [7/8]

template<typename T >
Komplex< T >::Komplex ( const Komplex< T > &  org)
default

◆ Komplex() [8/8]

template<typename T >
Komplex< T >::Komplex ( Komplex< T > &&  org)
default

◆ ~Komplex() [2/2]

template<typename T >
Komplex< T >::~Komplex ( )
default

Member Function Documentation

◆ Get_im() [1/2]

template<typename T >
T Komplex< T >::Get_im ( ) const
inline

Abfrage des Imaginaerteils

Returns
Imaginaerteil

Definition at line 59 of file komplex.h.

Here is the caller graph for this function:

◆ Get_im() [2/2]

template<typename T >
T Komplex< T >::Get_im ( ) const
inline

Abfrage des Imaginaerteils

Returns
Imaginaerteil

Definition at line 62 of file komplex2.h.

◆ Get_re() [1/2]

template<typename T >
T Komplex< T >::Get_re ( ) const
inline

Abfrage des Realteils

Returns
Realteil

Definition at line 44 of file komplex.h.

Here is the caller graph for this function:

◆ Get_re() [2/2]

template<typename T >
T Komplex< T >::Get_re ( ) const
inline

Abfrage des Realteils

Returns
Realteil

Definition at line 47 of file komplex2.h.

◆ operator+() [1/2]

template<typename T >
Komplex<T> Komplex< T >::operator+ ( const Komplex< T > &  rhs) const

Addiert die aktuelle Instanz mit einer zweiten komplexen Zahl

Parameters
[in]rhszweite komplexe Zahl
Returns
*this + rhs

◆ operator+() [2/2]

template<typename T >
Komplex<T> Komplex< T >::operator+ ( const Komplex< T > &  rhs) const

Addiert die aktuelle Instanz mit einer zweiten komplexen Zahl

Parameters
[in]rhszweite komplexe Zahl
Returns
*this + rhs

◆ operator+=() [1/2]

template<typename T >
Komplex<T>& Komplex< T >::operator+= ( const Komplex< T > &  rhs)

Addiert zur aktuellen Instanz eine zweite komplexe Zahl

Parameters
[in]rhszweite komplexe Zahl
Returns
*this += rhs

◆ operator+=() [2/2]

template<typename T >
Komplex<T>& Komplex< T >::operator+= ( const Komplex< T > &  rhs)

Addiert zur aktuellen Instanz eine zweite komplexe Zahl

Parameters
[in]rhszweite komplexe Zahl
Returns
*this += rhs

◆ operator<() [1/2]

template<typename T >
bool Komplex< T >::operator< ( const Komplex< T > &  rhs) const
inline

Definition at line 84 of file komplex.h.

◆ operator<() [2/2]

template<typename T >
bool Komplex< T >::operator< ( const Komplex< T > &  rhs) const
inline

Definition at line 87 of file komplex2.h.

◆ operator=() [1/4]

template<typename T >
Komplex<T>& Komplex< T >::operator= ( const Komplex< T > &  rhs)
default

◆ operator=() [2/4]

template<typename T >
Komplex<T>& Komplex< T >::operator= ( const Komplex< T > &  rhs)
default

◆ operator=() [3/4]

template<typename T >
Komplex<T>& Komplex< T >::operator= ( Komplex< T > &&  rhs)
default

◆ operator=() [4/4]

template<typename T >
Komplex<T>& Komplex< T >::operator= ( Komplex< T > &&  rhs)
default

◆ operator==() [1/2]

template<typename T >
bool Komplex< T >::operator== ( const Komplex< T > &  rhs) const
inline

Definition at line 89 of file komplex.h.

◆ operator==() [2/2]

template<typename T >
bool Komplex< T >::operator== ( const Komplex< T > &  rhs) const
inline

Definition at line 92 of file komplex2.h.

◆ operator>() [1/2]

template<typename T >
bool Komplex< T >::operator> ( const Komplex< T > &  rhs) const
inline

Definition at line 94 of file komplex.h.

◆ operator>() [2/2]

template<typename T >
bool Komplex< T >::operator> ( const Komplex< T > &  rhs) const
inline

Definition at line 97 of file komplex2.h.

◆ Set_im() [1/2]

template<typename T >
void Komplex< T >::Set_im ( val)
inline

Setzen des Realteils

Parameters
[in]valNew value to set

Definition at line 66 of file komplex.h.

◆ Set_im() [2/2]

template<typename T >
void Komplex< T >::Set_im ( val)
inline

Setzen des Realteils

Parameters
[in]valNew value to set

Definition at line 69 of file komplex2.h.

◆ Set_re() [1/2]

template<typename T >
void Komplex< T >::Set_re ( val)
inline

Abfrage des Realteils

Parameters
[in]valNew value to set

Definition at line 51 of file komplex.h.

◆ Set_re() [2/2]

template<typename T >
void Komplex< T >::Set_re ( val)
inline

Abfrage des Realteils

Parameters
[in]valNew value to set

Definition at line 54 of file komplex2.h.

Friends And Related Function Documentation

◆ operator<< [1/2]

template<typename T >
template<class S >
std::ostream& operator<< ( std::ostream &  s,
const Komplex< S > &  rhs 
)
friend

Ausgabeoperator fuer die Klasse.

Parameters
[in]sein beliebiger Ausgabestrom
[in]rhsdie auszugebende Instanz

◆ operator<< [2/2]

template<typename T >
template<class S >
std::ostream& operator<< ( std::ostream &  s,
const Komplex< S > &  rhs 
)
friend

Ausgabeoperator fuer die Klasse.

Parameters
[in]sein beliebiger Ausgabestrom
[in]rhsdie auszugebende Instanz

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