Class Komplex + STL
Komplex Class Reference

#include <komplex.h>

Public Member Functions

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

Detailed Description

Klasse fuer komplexe Zahlen zur Demonstration.

Definition at line 7 of file komplex.h.

Constructor & Destructor Documentation

◆ Komplex() [1/4]

Komplex::Komplex ( )

Default constructor

Definition at line 8 of file komplex.cpp.

◆ Komplex() [2/4]

Komplex::Komplex ( double  re,
double  im = 0.0 
)

Parameter constructor

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

Definition at line 12 of file komplex.cpp.

◆ Komplex() [3/4]

Komplex::Komplex ( const Komplex org)
default

◆ Komplex() [4/4]

Komplex::Komplex ( Komplex &&  org)
default

◆ ~Komplex()

Komplex::~Komplex ( )
default

Member Function Documentation

◆ abs()

double Komplex::abs ( ) const
inline

Berechnet den Betrag. Nutzt hypot aus cmath.

Returns
Betrag der komplexen Zahl

Definition at line 92 of file komplex.h.

◆ Get_im()

double Komplex::Get_im ( ) const
inline

Abfrage des Imaginaerteils

Returns
Imaginaerteil

Definition at line 49 of file komplex.h.

Here is the caller graph for this function:

◆ Get_re()

double Komplex::Get_re ( ) const
inline

Abfrage des Realteils

Returns
Realteil

Definition at line 32 of file komplex.h.

Here is the caller graph for this function:

◆ operator+=()

Komplex & Komplex::operator+= ( const Komplex rhs)

Addiert zur aktuellen Instanz eine zweiten komplexen Zahl

Parameters
[in]rhszweite komplexe Zahl
Returns
aktuelle Instanz

Definition at line 16 of file komplex.cpp.

◆ operator<()

bool Komplex::operator< ( const Komplex rhs) const
inline

Addiert die aktuelle Instanz mit einer zweiten komplexen Zahl

Parameters
[in]rhszweite komplexe Zahl
Returns
*this + rhs Vergleicht die aktuelle Instanz mit einer zweiten komplexen Zahl. Es werden nur die Realantele verglichen.
Parameters
[in]rhszweite komplexe Zahl
Returns
*this < rhs

Definition at line 81 of file komplex.h.

◆ operator=() [1/2]

Komplex& Komplex::operator= ( const Komplex rhs)
default

◆ operator=() [2/2]

Komplex& Komplex::operator= ( Komplex &&  rhs)
default

◆ Set_im()

void Komplex::Set_im ( double  val)
inline

Setzen des Imaginaerteils

Parameters
[in]valNew value to set

Definition at line 57 of file komplex.h.

◆ Set_re()

void Komplex::Set_re ( double  val)
inline

Setzen des Realteils

Parameters
[in]valNew value to set

Definition at line 40 of file komplex.h.


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