Loading...
Searching...
No Matches
Roots< N > Class Template Reference

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

#include <Roots.H>

Inheritance diagram for Roots< N >:
Collaboration diagram for Roots< N >:

Public Member Functions

 Roots ()
 Default construct as 'nan'.
 Roots (const roots::type t, const scalar x)
 Construct with a uniform value.
 Roots (const roots::type t, const scalar x, const Roots< N - 1 > &xs)
 Construct by concatenation.
 Roots (const Roots< N - 1 > &xs, const roots::type t, const scalar x)
 Construct by concatenation.
template<direction M>
 Roots (const Roots< M > &xs, const Roots< N - M > &ys)
 Construct by concatenation.
void type (const direction i, const roots::type t)
 Set the type of the i-th root.
roots::type type (const direction i) const
 Return the type of the i-th root.
Public Member Functions inherited from VectorSpace< Roots< N >, scalar, N >
const Foam::VectorSpace< Roots< N >, scalar, Ncmpts >::template ConstBlock< SubVector, BStart > block () const
 VectorSpace ()=default
 Default construct.
const scalar & component (const direction) const
void replace (const direction, const scalar &)
const scalar * cdata () const noexcept
 Return const pointer to the first data element.
scalar * data () noexcept
 Return pointer to the first data element.
void fill (const scalar &s)
 Assign all components to given value.
const scalar & operator[] (const direction) const
void operator= (const VectorSpace< Roots< N >, scalar, Ncmpts > &)
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 (pointer) to begin of VectorSpace.
const_iterator cbegin () const noexcept
 Return const_iterator (const pointer) to begin of VectorSpace.
iterator end () noexcept
 Return an iterator (pointer) to end of VectorSpace.
const_iterator cend () const noexcept
 Return const_iterator (const pointer) to end of VectorSpace.

Additional Inherited Members

Public Types inherited from VectorSpace< Roots< N >, scalar, N >
typedef VectorSpace< Roots< N >, scalar, Ncmpts > vsType
 VectorSpace type.
typedef scalar cmptType
 Component type.
typedef scalar magType
 Magnitude type.
typedef direction size_type
 The type to represent the size of a VectorSpace.
typedef scalar * iterator
 Random access iterator for traversing VectorSpace.
typedef const scalar * const_iterator
 Random access iterator for traversing VectorSpace.
Static Public Member Functions inherited from VectorSpace< Roots< N >, scalar, N >
static constexpr direction size () noexcept
 The number of elements in the VectorSpace = Ncmpts.
static Roots< Nuniform (const scalar &s)
 Return a VectorSpace with all elements = s.
Public Attributes inherited from VectorSpace< Roots< N >, scalar, N >
scalar v_ [Ncmpts]
 The components of this vector space.
Static Public Attributes inherited from VectorSpace< Roots< N >, scalar, N >
static constexpr direction dim
 Dimensionality of space.
static constexpr direction nComponents
 Number of components in this vector space.
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 68 of file Roots.H.

Constructor & Destructor Documentation

◆ Roots() [1/5]

template<Foam::direction N>
Roots ( )
inline

Default construct as 'nan'.

Definition at line 24 of file RootsI.H.

References forAll, Foam::roots::nan, and type().

Referenced by Roots(), Roots(), and Roots().

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

◆ Roots() [2/5]

template<Foam::direction N>
Roots ( const roots::type t,
const scalar x )
inline

Construct with a uniform value.

Definition at line 36 of file RootsI.H.

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

Here is the call graph for this function:

◆ Roots() [3/5]

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

Construct by concatenation.

Definition at line 49 of file RootsI.H.

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

Here is the call graph for this function:

◆ Roots() [4/5]

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

Construct by concatenation.

Definition at line 69 of file RootsI.H.

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

Here is the call graph for this function:

◆ Roots() [5/5]

template<Foam::direction N>
template<Foam::direction M>
Roots ( const Roots< M > & xs,
const Roots< N - M > & ys )
inline

Construct by concatenation.

Definition at line 90 of file RootsI.H.

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

Here is the call graph for this function:

Member Function Documentation

◆ type() [1/2]

template<Foam::direction N>
void type ( const direction i,
const roots::type t )
inline

Set the type of the i-th root.

Definition at line 114 of file RootsI.H.

References Foam::type().

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

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

◆ type() [2/2]

template<Foam::direction N>
Foam::roots::type type ( const direction i) const
inline

Return the type of the i-th root.

Definition at line 125 of file RootsI.H.


The documentation for this class was generated from the following files:
  • src/OpenFOAM/primitives/polynomialEqns/Roots.H
  • src/OpenFOAM/primitives/polynomialEqns/RootsI.H