Roots< N > Class Template Reference

Templated storage for the roots of polynomial equations, plus flags to indicate the nature of the roots. More...

Inheritance diagram for Roots< N >:
[legend]
Collaboration diagram for Roots< N >:
[legend]

Public Member Functions

 Roots ()
 Construct null. More...
 
 Roots (const roots::type t, const scalar x)
 Construct with a uniform value. More...
 
 Roots (const roots::type t, const scalar x, const Roots< N - 1 > &xs)
 Construct by concatenation. More...
 
 Roots (const Roots< N - 1 > &xs, const roots::type t, const scalar x)
 Construct by concatenation. More...
 
template<direction M>
 Roots (const Roots< M > &xs, const Roots< N - M > &ys)
 Construct by concatenation. More...
 
void type (const direction i, const roots::type t)
 Set the type of the i-th root. More...
 
roots::type type (const direction i) const
 Return the type of the i-th root. More...
 
- Public Member Functions inherited from VectorSpace< Roots< N >, scalar, N >
 VectorSpace ()=default
 Default construct. More...
 
 VectorSpace (const Foam::zero)
 Construct initialized to zero. More...
 
 VectorSpace (const VectorSpace< Roots< N >, 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< Roots< N >, scalar, Ncmpts >::template ConstBlock< SubVector, BStart > block () const
 
const scalar & operator[] (const direction) const
 
scalar & operator[] (const direction)
 
void operator= (const VectorSpace< Roots< N >, scalar, Ncmpts > &)
 
void operator= (const Foam::zero)
 
void operator+= (const VectorSpace< Roots< N >, scalar, Ncmpts > &)
 
void operator-= (const VectorSpace< Roots< N >, 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

- Public Types inherited from VectorSpace< Roots< N >, scalar, N >
typedef VectorSpace< Roots< N >, 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...
 
- Static Public Member Functions inherited from VectorSpace< Roots< N >, scalar, N >
static constexpr direction size () noexcept
 The number of elements in the VectorSpace = Ncmpts. More...
 
static Roots< Nuniform (const scalar &s)
 Return a VectorSpace with all elements = s. More...
 
- Public Attributes inherited from VectorSpace< Roots< N >, scalar, N >
scalar v_ [Ncmpts]
 The components of this vector space. More...
 
- Static Public Attributes inherited from VectorSpace< Roots< N >, scalar, N >
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 Roots< Nzero
 
static const Roots< None
 
static const Roots< Nmax
 
static const Roots< Nmin
 
static const Roots< NrootMax
 
static const Roots< NrootMin
 

Detailed Description

template<direction N>
class Foam::Roots< N >

Templated storage for the roots of polynomial equations, plus flags to indicate the nature of the roots.

Source files

Definition at line 70 of file Roots.H.

Constructor & Destructor Documentation

◆ Roots() [1/5]

Roots
inline

Construct null.

Definition at line 31 of file RootsI.H.

References forAll, Foam::roots::nan, and Roots< N >::type().

Here is the call graph for this function:

◆ Roots() [2/5]

Roots ( const roots::type  t,
const scalar  x 
)
inline

Construct with a uniform value.

Definition at line 43 of file RootsI.H.

References forAll, Roots< N >::type(), VectorSpace< Roots< N >, scalar, N >::v_, and x.

Here is the call graph for this function:

◆ Roots() [3/5]

Roots ( const roots::type  t,
const scalar  x,
const Roots< N - 1 > &  xs 
)
inline

Construct by concatenation.

Definition at line 56 of file RootsI.H.

References forAll, Roots< N >::type(), VectorSpace< Roots< N >, scalar, N >::v_, and x.

Here is the call graph for this function:

◆ Roots() [4/5]

Roots ( const Roots< N - 1 > &  xs,
const roots::type  t,
const scalar  x 
)
inline

Construct by concatenation.

Definition at line 76 of file RootsI.H.

References forAll, N(), Roots< N >::type(), VectorSpace< Roots< N >, scalar, N >::v_, and x.

Here is the call graph for this function:

◆ Roots() [5/5]

Roots ( const Roots< M > &  xs,
const Roots< N - M > &  ys 
)
inline

Construct by concatenation.

Definition at line 97 of file RootsI.H.

References forAll, M, Roots< N >::type(), and VectorSpace< Roots< N >, scalar, N >::v_.

Here is the call graph for this function:

Member Function Documentation

◆ type() [1/2]

void type ( const direction  i,
const roots::type  t 
)
inline

Set the type of the i-th root.

Definition at line 121 of file RootsI.H.

References Foam::type().

Referenced by Foam::eigenValues(), Roots< N >::Roots(), and cubicEqn::roots().

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

◆ type() [2/2]

Foam::roots::type type ( const direction  i) const
inline

Return the type of the i-th root.

Definition at line 132 of file RootsI.H.


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