Eq2deg
Classes | Public Member Functions | Protected Attributes | List of all members
Eq2deg Class Reference

#include <Eq2deg.hpp>

Inheritance diagram for Eq2deg:
Inheritance graph
[legend]
Collaboration diagram for Eq2deg:
Collaboration graph
[legend]

Classes

struct  NegativeDeltaException
 Object to handle exception when no reals roots exists. More...
 

Public Member Functions

 Eq2deg (const double &iA, const double &iB, const double &iC)
 Construct a new Eq2deg object. More...
 
virtual ~Eq2deg ()
 
virtual void computeDelta ()
 compute the discriminant and raise an exception if negative More...
 
virtual void computeRoots ()
 Compute the roots. More...
 
double getRoot (const int &iRootNumber) const
 Get the root value by number. More...
 
virtual double getDelta ()
 Get the discriminant. More...
 
- Public Member Functions inherited from Utilities
void toStream (std::ostream &ioOut) const
 

Protected Attributes

double m_a
 
double m_b
 
double m_c
 
double m_delta
 
std::vector< double > m_rac
 

Detailed Description

CS-17, Eq2deg.hpp Base class to manage quadratics equations a*x^2+b*x+c=0

with the following restrictions: The coefficients are real The roots are real In case of complex roots an exception is thrown

Author
Christophe Gattardi
Version
1.0 15/03/2020

Constructor & Destructor Documentation

◆ Eq2deg()

Eq2deg::Eq2deg ( const double &  iA,
const double &  iB,
const double &  iC 
)

Construct a new Eq2deg object.

Parameters
adouble: coefficent of x^2
bdouble: coefficient of x
cdouble: constant

◆ ~Eq2deg()

Eq2deg::~Eq2deg ( )
virtual

Member Function Documentation

◆ computeDelta()

void Eq2deg::computeDelta ( )
virtual

compute the discriminant and raise an exception if negative

Reimplemented in Eq2degComp.

◆ computeRoots()

void Eq2deg::computeRoots ( )
virtual

Compute the roots.

Reimplemented in Eq2degComp.

◆ getDelta()

double Eq2deg::getDelta ( )
virtual

Get the discriminant.

Returns
double

◆ getRoot()

double Eq2deg::getRoot ( const int &  iRootNumber) const

Get the root value by number.

Parameters
rootNumberthe number of the root to retrieve (1 or 2)
Returns
double

Member Data Documentation

◆ m_a

double Eq2deg::m_a
protected

◆ m_b

double Eq2deg::m_b
protected

◆ m_c

double Eq2deg::m_c
protected

◆ m_delta

double Eq2deg::m_delta
protected

◆ m_rac

std::vector<double> Eq2deg::m_rac
protected

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