Quadratic equation of the form a*x^2 + b*x + c = 0. More...
Classes | |
struct | coefficient |
Coefficient indexing enumeration. More... | |
Public Member Functions | |
quadraticEqn () | |
Construct null. More... | |
quadraticEqn (const Foam::zero) | |
Construct initialized to zero. More... | |
quadraticEqn (const scalar a, const scalar b, const scalar c) | |
Construct from components. More... | |
scalar | a () const |
scalar | b () const |
scalar | c () const |
scalar & | a () |
scalar & | b () |
scalar & | c () |
scalar | value (const scalar x) const |
Evaluate at x. More... | |
scalar | derivative (const scalar x) const |
Evaluate the derivative at x. More... | |
scalar | error (const scalar x) const |
Estimate the error of evaluation at x. More... | |
Roots< 2 > | roots () const |
Get the roots. More... | |
Public Member Functions inherited from VectorSpace< quadraticEqn, scalar, 3 > | |
VectorSpace () | |
Construct null. More... | |
VectorSpace (const Foam::zero) | |
Construct initialized to zero. More... | |
VectorSpace (Istream &) | |
Construct from Istream. More... | |
VectorSpace (const VectorSpace< Form2, Cmpt2, Ncmpts > &) | |
Construct as copy of a VectorSpace with the same size. More... | |
const scalar & | component (const direction) const |
scalar & | component (const direction) |
void | component (scalar &, const direction) const |
void | replace (const direction, const scalar &) |
const ConstBlock< SubVector, BStart > | block () const |
const VectorSpace< quadraticEqn, scalar, Ncmpts >::template ConstBlock< SubVector, BStart > | block () const |
const scalar & | operator[] (const direction) const |
scalar & | operator[] (const direction) |
void | operator+= (const VectorSpace< quadraticEqn, scalar, Ncmpts > &) |
void | operator-= (const VectorSpace< quadraticEqn, scalar, Ncmpts > &) |
void | operator= (const Foam::zero) |
void | operator*= (const scalar) |
void | operator/= (const scalar) |
Additional Inherited Members | |
Public Types inherited from VectorSpace< quadraticEqn, scalar, 3 > | |
typedef VectorSpace< quadraticEqn, scalar, Ncmpts > | vsType |
VectorSpace type. More... | |
typedef scalar | cmptType |
Component type. More... | |
Static Public Member Functions inherited from VectorSpace< quadraticEqn, scalar, 3 > | |
static direction | size () |
Return the number of elements in the VectorSpace = Ncmpts. More... | |
static quadraticEqn | uniform (const scalar &s) |
Return a VectorSpace with all elements = s. More... | |
Public Attributes inherited from VectorSpace< quadraticEqn, scalar, 3 > | |
scalar | v_ [Ncmpts] |
The components of this vector space. More... | |
Static Public Attributes inherited from VectorSpace< quadraticEqn, scalar, 3 > | |
static const direction | dim |
Dimensionality of space. More... | |
static const direction | nComponents |
Number of components in this vector space. More... | |
static const direction | mRows |
static const direction | nCols |
static const char *const | typeName |
static const char *const | componentNames [] |
static const quadraticEqn | zero |
static const quadraticEqn | one |
static const quadraticEqn | max |
static const quadraticEqn | min |
static const quadraticEqn | rootMax |
static const quadraticEqn | rootMin |
Quadratic equation of the form a*x^2 + b*x + c = 0.
Definition at line 49 of file quadraticEqn.H.
|
inline |
Construct null.
Definition at line 28 of file quadraticEqnI.H.
Referenced by quadraticEqn::quadraticEqn().
|
inline |
Construct initialized to zero.
Definition at line 32 of file quadraticEqnI.H.
References quadraticEqn::quadraticEqn().
|
inline |
Construct from components.
Definition at line 39 of file quadraticEqnI.H.
References quadraticEqn::coefficient::a, quadraticEqn::a(), quadraticEqn::coefficient::b, quadraticEqn::b(), quadraticEqn::coefficient::c, quadraticEqn::c(), and VectorSpace< quadraticEqn, scalar, 3 >::v_.
|
inline |
Definition at line 53 of file quadraticEqnI.H.
References quadraticEqn::coefficient::a, and VectorSpace< quadraticEqn, scalar, 3 >::v_.
Referenced by quadraticEqn::derivative(), quadraticEqn::error(), quadraticEqn::quadraticEqn(), quadraticEqn::roots(), and quadraticEqn::value().
|
inline |
Definition at line 59 of file quadraticEqnI.H.
References quadraticEqn::coefficient::b, and VectorSpace< quadraticEqn, scalar, 3 >::v_.
Referenced by quadraticEqn::derivative(), quadraticEqn::error(), quadraticEqn::quadraticEqn(), quadraticEqn::roots(), and quadraticEqn::value().
|
inline |
Definition at line 65 of file quadraticEqnI.H.
References quadraticEqn::coefficient::c, and VectorSpace< quadraticEqn, scalar, 3 >::v_.
Referenced by quadraticEqn::error(), quadraticEqn::quadraticEqn(), quadraticEqn::roots(), and quadraticEqn::value().
|
inline |
Definition at line 71 of file quadraticEqnI.H.
References quadraticEqn::coefficient::a, and VectorSpace< quadraticEqn, scalar, 3 >::v_.
|
inline |
Definition at line 77 of file quadraticEqnI.H.
References quadraticEqn::coefficient::b, and VectorSpace< quadraticEqn, scalar, 3 >::v_.
|
inline |
Definition at line 83 of file quadraticEqnI.H.
References quadraticEqn::coefficient::c, and VectorSpace< quadraticEqn, scalar, 3 >::v_.
|
inline |
Evaluate at x.
Definition at line 89 of file quadraticEqnI.H.
References quadraticEqn::a(), quadraticEqn::b(), and quadraticEqn::c().
|
inline |
Evaluate the derivative at x.
Definition at line 95 of file quadraticEqnI.H.
References quadraticEqn::a(), and quadraticEqn::b().
|
inline |
Estimate the error of evaluation at x.
Definition at line 101 of file quadraticEqnI.H.
References quadraticEqn::a(), quadraticEqn::b(), quadraticEqn::c(), and Foam::mag().
Foam::Roots< 2 > roots | ( | ) | const |
Get the roots.
Definition at line 31 of file quadraticEqn.C.
References quadraticEqn::a(), quadraticEqn::b(), quadraticEqn::c(), Foam::complex, Foam::nan, linearEqn::roots(), Foam::sign(), Foam::sqrt(), and x.
Referenced by cubicEqn::roots().