Template class Komplex alt
Komplex< T > Class Template Reference

#include <komplex.h>

Public Member Functions

 Komplex ()
 
 Komplex (T re, T im=0.0)
 
 Komplex (const Komplex< T > &orig)=default
 
Komplex< T > & operator= (const Komplex< T > &rhs)=default
 
virtual ~Komplex ()
 
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)
 

Detailed Description

template<class 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 13 of file komplex.h.

Constructor & Destructor Documentation

◆ Komplex() [1/3]

template<class T >
Komplex< T >::Komplex ( )

Default constructor

◆ Komplex() [2/3]

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

Parameter constructor

◆ Komplex() [3/3]

template<class T >
Komplex< T >::Komplex ( const Komplex< T > &  orig)
default

◆ ~Komplex()

template<class T >
virtual Komplex< T >::~Komplex ( )
virtual

Default destructor

Member Function Documentation

◆ Get_im()

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

Abfrage des Imaginaerteils

Returns
Imaginaerteil

Definition at line 46 of file komplex.h.

Here is the caller graph for this function:

◆ Get_re()

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

Abfrage des Realteils

Returns
Realteil

Definition at line 31 of file komplex.h.

Here is the caller graph for this function:

◆ operator+()

template<class 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+=()

template<class 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<()

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

Definition at line 71 of file komplex.h.

◆ operator=()

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

◆ operator==()

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

Definition at line 76 of file komplex.h.

◆ operator>()

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

Definition at line 81 of file komplex.h.

◆ Set_im()

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

Setzen des Realteils

Parameters
[in]valNew value to set

Definition at line 53 of file komplex.h.

◆ Set_re()

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

Abfrage des Realteils

Parameters
[in]valNew value to set

Definition at line 38 of file komplex.h.

Friends And Related Function Documentation

◆ operator<<

template<class 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 file: