SurgSim::Math::PolynomialRootsCommon< T, N > Class Template Reference

The common base class for PolynomialRoots specializations for various N. More...

`#include <SurgSim/Math/PolynomialRoots.h>`

## Public Member Functions

bool | isDegenerate () const
int | getNumRoots () const
T | operator[] (int i) const
| Read only access to the roots of the polynomial. More...

## Static Public Attributes

static const int | DEGENERATE = -1
| Indicator for a degenerate polynomial (infinite number of roots). More...

## Protected Member Functions

| PolynomialRootsCommon ()
| Constructor. Since the constructor must define the roots, only allow construction from a derived class. More...

## Protected Attributes

int | m_numRoots
| The number of roots available for the polynomial, or DEGENERATE if there are infinite roots. More...
std::array< T, N > | m_roots
| An array of up to N roots for a degree N polynomial ordered ascendingly. More...

## Private Member Functions

| PolynomialRootsCommon (const PolynomialRootsCommon &)
PolynomialRootsCommon & | operator= (const PolynomialRootsCommon &)

## Detailed Description

### template<typename T, int N>
class SurgSim::Math::PolynomialRootsCommon< T, N >

The common base class for PolynomialRoots specializations for various N.

Template Parameters

  T | type of the coefficients and computations
  N | degree of the polynomial for which roots are being calculated

See also
  PolynomialRoots<T, N>

## Constructor & Destructor Documentation

## PolynomialRootsCommon() [1/2]

template<typename T, int N>

SurgSim::Math::PolynomialRootsCommon< T, N >::PolynomialRootsCommon | ( | const PolynomialRootsCommon< T, N > & |  | ) |

private

Prohibit copying and assignment.

## PolynomialRootsCommon() [2/2]

template<typename T, int N>

SurgSim::Math::PolynomialRootsCommon< T, N >::PolynomialRootsCommon | ( |  | ) |

inline protected

Constructor. Since the constructor must define the roots, only allow construction from a derived class.

## Member Function Documentation

## getNumRoots()

template<typename T , int N>

int SurgSim::Math::PolynomialRootsCommon< T, N >::getNumRoots | ( |  | ) | const

Returns
  the number of available roots or DEGENERATE if there are infinitely many

## isDegenerate()

template<typename T , int N>

bool SurgSim::Math::PolynomialRootsCommon< T, N >::isDegenerate | ( |  | ) | const

Returns
  true in the polynomial is degenerate

## operator=()

template<typename T, int N>

PolynomialRootsCommon& SurgSim::Math::PolynomialRootsCommon< T, N >::operator= | ( | const PolynomialRootsCommon< T, N > & |  | ) |

private

Prohibit copying and assignment.

## operator[]()

template<typename T , int N>

T SurgSim::Math::PolynomialRootsCommon< T, N >::operator[] | ( | int | i | ) | const

Read only access to the roots of the polynomial.

Parameters

  i | is the number of the root to return

Returns
  the value of the ith root

Exceptions

  if | there is no root of rank i

Note
  The roots are ordered ascendingly, so PolynomialRootsCommon[0] < PolynomialRootsCommon[1] < ...

## Member Data Documentation

## DEGENERATE

template<typename T, int N>

const int SurgSim::Math::PolynomialRootsCommon< T, N >::DEGENERATE = -1

static

Indicator for a degenerate polynomial (infinite number of roots).

## m_numRoots

template<typename T, int N>

int SurgSim::Math::PolynomialRootsCommon< T, N >::m_numRoots

protected

The number of roots available for the polynomial, or DEGENERATE if there are infinite roots.

## m_roots

template<typename T, int N>

std::array<T, N> SurgSim::Math::PolynomialRootsCommon< T, N >::m_roots

protected

An array of up to N roots for a degree N polynomial ordered ascendingly.

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

- SurgSim/Math/PolynomialRoots.h
- SurgSim/Math/PolynomialRoots-inl.h