Cubic equation of the form a*x^3 + b*x^2 + c*x + d = 0. More...
Classes | |
struct | coefficient |
Coefficient indexing enumeration. More... | |
Public Member Functions | |
cubicEqn () | |
Construct null. More... | |
cubicEqn (const Foam::zero) | |
Construct initialised to zero. More... | |
cubicEqn (const scalar a, const scalar b, const scalar c, const scalar d) | |
Construct from components. More... | |
scalar | a () const |
scalar | b () const |
scalar | c () const |
scalar | d () const |
scalar & | a () |
scalar & | b () |
scalar & | c () |
scalar & | d () |
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< 3 > | roots () const |
Get the roots. More... | |
Public Member Functions inherited from VectorSpace< cubicEqn, scalar, 4 > | |
VectorSpace () | |
Construct null. More... | |
VectorSpace (const Foam::zero) | |
Construct initialised 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< cubicEqn, scalar, Ncmpts >::template ConstBlock< SubVector, BStart > | block () const |
const scalar & | operator[] (const direction) const |
scalar & | operator[] (const direction) |
void | operator+= (const VectorSpace< cubicEqn, scalar, Ncmpts > &) |
void | operator-= (const VectorSpace< cubicEqn, scalar, Ncmpts > &) |
void | operator= (const Foam::zero) |
void | operator*= (const scalar) |
void | operator/= (const scalar) |
Additional Inherited Members | |
Public Types inherited from VectorSpace< cubicEqn, scalar, 4 > | |
typedef VectorSpace< cubicEqn, scalar, Ncmpts > | vsType |
VectorSpace type. More... | |
typedef scalar | cmptType |
Component type. More... | |
Static Public Member Functions inherited from VectorSpace< cubicEqn, scalar, 4 > | |
static direction | size () |
Return the number of elements in the VectorSpace = Ncmpts. More... | |
static cubicEqn | uniform (const scalar &s) |
Return a VectorSpace with all elements = s. More... | |
Public Attributes inherited from VectorSpace< cubicEqn, scalar, 4 > | |
scalar | v_ [Ncmpts] |
The components of this vector space. More... | |
Static Public Attributes inherited from VectorSpace< cubicEqn, scalar, 4 > | |
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 cubicEqn | zero |
static const cubicEqn | one |
static const cubicEqn | max |
static const cubicEqn | min |
static const cubicEqn | rootMax |
static const cubicEqn | rootMin |
Cubic equation of the form a*x^3 + b*x^2 + c*x + d = 0.
Definition at line 49 of file cubicEqn.H.
|
inline |
Construct null.
Definition at line 28 of file cubicEqnI.H.
Referenced by cubicEqn::cubicEqn().
|
inline |
Construct initialised to zero.
Definition at line 32 of file cubicEqnI.H.
References cubicEqn::cubicEqn().
|
inline |
Construct from components.
Definition at line 39 of file cubicEqnI.H.
References cubicEqn::coefficient::a, cubicEqn::a(), cubicEqn::coefficient::b, cubicEqn::b(), cubicEqn::coefficient::c, cubicEqn::c(), cubicEqn::coefficient::d, cubicEqn::d(), and VectorSpace< cubicEqn, scalar, 4 >::v_.
|
inline |
Definition at line 55 of file cubicEqnI.H.
References cubicEqn::coefficient::a, and VectorSpace< cubicEqn, scalar, 4 >::v_.
Referenced by cubicEqn::cubicEqn(), cubicEqn::derivative(), cubicEqn::error(), cubicEqn::roots(), and cubicEqn::value().
|
inline |
Definition at line 61 of file cubicEqnI.H.
References cubicEqn::coefficient::b, and VectorSpace< cubicEqn, scalar, 4 >::v_.
Referenced by cubicEqn::cubicEqn(), cubicEqn::derivative(), cubicEqn::error(), cubicEqn::roots(), and cubicEqn::value().
|
inline |
Definition at line 67 of file cubicEqnI.H.
References cubicEqn::coefficient::c, and VectorSpace< cubicEqn, scalar, 4 >::v_.
Referenced by cubicEqn::cubicEqn(), cubicEqn::derivative(), cubicEqn::error(), cubicEqn::roots(), and cubicEqn::value().
|
inline |
Definition at line 73 of file cubicEqnI.H.
References cubicEqn::coefficient::d, and VectorSpace< cubicEqn, scalar, 4 >::v_.
Referenced by cubicEqn::cubicEqn(), cubicEqn::error(), cubicEqn::roots(), and cubicEqn::value().
|
inline |
Definition at line 79 of file cubicEqnI.H.
References cubicEqn::coefficient::a, and VectorSpace< cubicEqn, scalar, 4 >::v_.
|
inline |
Definition at line 85 of file cubicEqnI.H.
References cubicEqn::coefficient::b, and VectorSpace< cubicEqn, scalar, 4 >::v_.
|
inline |
Definition at line 91 of file cubicEqnI.H.
References cubicEqn::coefficient::c, and VectorSpace< cubicEqn, scalar, 4 >::v_.
|
inline |
Definition at line 97 of file cubicEqnI.H.
References cubicEqn::coefficient::d, and VectorSpace< cubicEqn, scalar, 4 >::v_.
|
inline |
Evaluate at x.
Definition at line 103 of file cubicEqnI.H.
References cubicEqn::a(), cubicEqn::b(), cubicEqn::c(), and cubicEqn::d().
Referenced by particle::trackToMovingTri().
|
inline |
Evaluate the derivative at x.
Definition at line 109 of file cubicEqnI.H.
References cubicEqn::a(), cubicEqn::b(), and cubicEqn::c().
|
inline |
Estimate the error of evaluation at x.
Definition at line 115 of file cubicEqnI.H.
References cubicEqn::a(), cubicEqn::b(), cubicEqn::c(), cubicEqn::d(), Foam::mag(), and Foam::magSqr().
Foam::Roots< 3 > roots | ( | ) | const |
Get the roots.
Definition at line 32 of file cubicEqn.C.
References cubicEqn::a(), Foam::atan2(), cubicEqn::b(), cubicEqn::c(), Foam::cbrt(), Foam::cos(), cubicEqn::d(), Foam::hypot(), Foam::mag(), Foam::nan, p, linearEqn::roots(), quadraticEqn::roots(), Foam::sign(), Foam::sin(), Foam::sqrt(), Roots< N >::type(), and x.
Referenced by Foam::eigenValues(), and Foam::triIntersect::solveProjection().