All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
linearEqn Class Reference

Linear equation of the form a*x + b = 0. More...

Inheritance diagram for linearEqn:
Collaboration diagram for linearEqn:

Classes

struct  coefficient
 Coefficient indexing enumeration. More...
 

Public Member Functions

 linearEqn ()
 Construct null. More...
 
 linearEqn (const Foam::zero)
 Construct initialized to zero. More...
 
 linearEqn (const scalar a, const scalar b)
 Construct from components. More...
 
scalar a () const
 
scalar b () const
 
scalar & a ()
 
scalar & b ()
 
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< 1 > roots () const
 Get the roots. More...
 
- Public Member Functions inherited from VectorSpace< linearEqn, scalar, 2 >
 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< linearEqn, scalar, Ncmpts >::template ConstBlock< SubVector, BStart > block () const
 
const scalar & operator[] (const direction) const
 
scalar & operator[] (const direction)
 
void operator+= (const VectorSpace< linearEqn, scalar, Ncmpts > &)
 
void operator-= (const VectorSpace< linearEqn, scalar, Ncmpts > &)
 
void operator= (const Foam::zero)
 
void operator*= (const scalar)
 
void operator/= (const scalar)
 

Additional Inherited Members

- Public Types inherited from VectorSpace< linearEqn, scalar, 2 >
typedef VectorSpace< linearEqn, scalar, Ncmpts > vsType
 VectorSpace type. More...
 
typedef scalar cmptType
 Component type. More...
 
- Static Public Member Functions inherited from VectorSpace< linearEqn, scalar, 2 >
static direction size ()
 Return the number of elements in the VectorSpace = Ncmpts. More...
 
static linearEqn uniform (const scalar &s)
 Return a VectorSpace with all elements = s. More...
 
- Public Attributes inherited from VectorSpace< linearEqn, scalar, 2 >
scalar v_ [Ncmpts]
 The components of this vector space. More...
 
- Static Public Attributes inherited from VectorSpace< linearEqn, scalar, 2 >
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 linearEqn zero
 
static const linearEqn one
 
static const linearEqn max
 
static const linearEqn min
 
static const linearEqn rootMax
 
static const linearEqn rootMin
 

Detailed Description

Linear equation of the form a*x + b = 0.

Source files

Definition at line 48 of file linearEqn.H.

Constructor & Destructor Documentation

◆ linearEqn() [1/3]

linearEqn ( )
inline

Construct null.

Definition at line 28 of file linearEqnI.H.

◆ linearEqn() [2/3]

linearEqn ( const Foam::zero  )
inline

Construct initialized to zero.

Definition at line 32 of file linearEqnI.H.

◆ linearEqn() [3/3]

linearEqn ( const scalar  a,
const scalar  b 
)
inline

Construct from components.

Definition at line 38 of file linearEqnI.H.

References linearEqn::coefficient::a, linearEqn::a(), linearEqn::coefficient::b, linearEqn::b(), and VectorSpace< linearEqn, scalar, 2 >::v_.

Here is the call graph for this function:

Member Function Documentation

◆ a() [1/2]

Foam::scalar a ( ) const
inline

Definition at line 47 of file linearEqnI.H.

References linearEqn::coefficient::a, and VectorSpace< linearEqn, scalar, 2 >::v_.

Referenced by linearEqn::derivative(), linearEqn::error(), linearEqn::linearEqn(), linearEqn::roots(), and linearEqn::value().

Here is the caller graph for this function:

◆ b() [1/2]

Foam::scalar b ( ) const
inline

Definition at line 53 of file linearEqnI.H.

References linearEqn::coefficient::b, and VectorSpace< linearEqn, scalar, 2 >::v_.

Referenced by linearEqn::error(), linearEqn::linearEqn(), linearEqn::roots(), and linearEqn::value().

Here is the caller graph for this function:

◆ a() [2/2]

Foam::scalar & a ( )
inline

◆ b() [2/2]

Foam::scalar & b ( )
inline

◆ value()

Foam::scalar value ( const scalar  x) const
inline

Evaluate at x.

Definition at line 71 of file linearEqnI.H.

References linearEqn::a(), and linearEqn::b().

Here is the call graph for this function:

◆ derivative()

Foam::scalar derivative ( const scalar  x) const
inline

Evaluate the derivative at x.

Definition at line 77 of file linearEqnI.H.

References linearEqn::a().

Here is the call graph for this function:

◆ error()

Foam::scalar error ( const scalar  x) const
inline

Estimate the error of evaluation at x.

Definition at line 83 of file linearEqnI.H.

References linearEqn::a(), linearEqn::b(), and Foam::mag().

Here is the call graph for this function:

◆ roots()

Foam::Roots< 1 > roots ( ) const
inline

Get the roots.

Definition at line 89 of file linearEqnI.H.

References linearEqn::a(), linearEqn::b(), Foam::mag(), Foam::nan, Foam::negInf, Foam::posInf, Foam::real, and Foam::sign().

Referenced by quadraticEqn::roots(), and cubicEqn::roots().

Here is the call graph for this function:
Here is the caller graph for this function:

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