linearEqn Class Reference

Container to encapsulate various operations for linear equation of the forms with real coefficients: More...

Inheritance diagram for linearEqn:
[legend]
Collaboration diagram for linearEqn:
[legend]

Public Types

enum  components { A , B }
 Component labeling enumeration. More...
 
- Public Types inherited from VectorSpace< linearEqn, scalar, 2 >
typedef VectorSpace< linearEqn, scalar, Ncmpts > vsType
 VectorSpace type. More...
 
typedef scalar cmptType
 Component type. More...
 
typedef scalar magType
 Magnitude type. More...
 
typedef scalar * iterator
 Random access iterator for traversing VectorSpace. More...
 
typedef const scalar * const_iterator
 Random access iterator for traversing VectorSpace. 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 the linear equation at x. More...
 
scalar derivative (const scalar x) const
 Evaluate the derivative of the linear equation at x. More...
 
scalar error (const scalar x) const
 Estimate the error of evaluation of the linear equation at x. More...
 
Roots< 1 > roots () const
 Return the real root of the linear equation. More...
 
- Public Member Functions inherited from VectorSpace< linearEqn, scalar, 2 >
 VectorSpace ()=default
 Default construct. More...
 
 VectorSpace (const Foam::zero)
 Construct initialized to zero. More...
 
 VectorSpace (const VectorSpace< linearEqn, scalar, Ncmpts > &vs)
 Copy construct. More...
 
 VectorSpace (const VectorSpace< Form2, Cmpt2, Ncmpts > &)
 Copy construct of a VectorSpace with the same size. More...
 
 VectorSpace (Istream &is)
 Construct from Istream. More...
 
const scalar & component (const direction) const
 
scalar & component (const direction)
 
void component (scalar &, const direction) const
 
void replace (const direction, const scalar &)
 
const scalar * cdata () const noexcept
 Return const pointer to the first data element. More...
 
scalar * data () noexcept
 Return pointer to the first data element. More...
 
const ConstBlock< SubVector, BStart > block () const
 
const Foam::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 Foam::zero)
 
void operator+= (const VectorSpace< linearEqn, scalar, Ncmpts > &)
 
void operator-= (const VectorSpace< linearEqn, scalar, Ncmpts > &)
 
void operator*= (const scalar)
 
void operator/= (const scalar)
 
iterator begin () noexcept
 Return an iterator to begin of VectorSpace. More...
 
const_iterator begin () const noexcept
 Return const_iterator to begin of VectorSpace. More...
 
iterator end () noexcept
 Return an iterator to end of VectorSpace. More...
 
const_iterator end () const noexcept
 Return const_iterator to end of VectorSpace. More...
 
const_iterator cbegin () const noexcept
 Return const_iterator to begin of VectorSpace. More...
 
const_iterator cend () const noexcept
 Return const_iterator to end of VectorSpace. More...
 

Additional Inherited Members

- Static Public Member Functions inherited from VectorSpace< linearEqn, scalar, 2 >
static constexpr direction size () noexcept
 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 constexpr direction dim
 Dimensionality of space. More...
 
static constexpr direction nComponents
 Number of components in this vector space. More...
 
static constexpr direction mRows
 
static constexpr 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

Container to encapsulate various operations for linear equation of the forms with real coefficients:

\[ a*x + b = 0 x + B = 0 \]

See also
Test-linearEqn.C
Source files

Definition at line 60 of file linearEqn.H.

Member Enumeration Documentation

◆ components

enum components

Component labeling enumeration.

Enumerator

Definition at line 67 of file linearEqn.H.

Constructor & Destructor Documentation

◆ linearEqn() [1/3]

linearEqn ( )
inline

Construct null.

Definition at line 31 of file linearEqnI.H.

◆ linearEqn() [2/3]

linearEqn ( const Foam::zero  )
inline

Construct initialized to zero.

Definition at line 35 of file linearEqnI.H.

◆ linearEqn() [3/3]

linearEqn ( const scalar  a,
const scalar  b 
)
inline

Construct from components.

Definition at line 41 of file linearEqnI.H.

References A, b, and B.

Member Function Documentation

◆ a() [1/2]

Foam::scalar a ( ) const
inline

Definition at line 50 of file linearEqnI.H.

References A.

◆ b() [1/2]

Foam::scalar b ( ) const
inline

Definition at line 56 of file linearEqnI.H.

References B.

◆ a() [2/2]

Foam::scalar & a ( )
inline

Definition at line 62 of file linearEqnI.H.

References A.

◆ b() [2/2]

Foam::scalar & b ( )
inline

Definition at line 68 of file linearEqnI.H.

References B.

◆ value()

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

Evaluate the linear equation at x.

Definition at line 74 of file linearEqnI.H.

References b, linearEqn::value(), and x.

Referenced by linearEqn::value().

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

◆ derivative()

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

Evaluate the derivative of the linear equation at x.

Definition at line 80 of file linearEqnI.H.

◆ error()

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

Estimate the error of evaluation of the linear equation at x.

Definition at line 86 of file linearEqnI.H.

References b, Foam::mag(), and x.

Here is the call graph for this function:

◆ roots()

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

Return the real root of the linear equation.

Definition at line 92 of file linearEqnI.H.

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

Here is the call graph for this function:

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