dune-functions 2.9.0
Public Member Functions | Friends | List of all members
Dune::Functions::Polynomial< K > Class Template Reference

A scalar polynomial implementation. More...

#include <dune/functions/analyticfunctions/polynomial.hh>

Public Member Functions

 Polynomial ()=default
 Default constructor. More...
 
 Polynomial (const Polynomial &other)=default
 Copy constructor. More...
 
 Polynomial (Polynomial &&other)=default
 Move constructor. More...
 
Polynomialoperator= (const Polynomial &other)=default
 Copy-assignment operator. More...
 
Polynomialoperator= (Polynomial &&other)=default
 Move-assignment operator. More...
 
 Polynomial (std::initializer_list< K > coefficients)
 Create from list of coefficients. More...
 
 Polynomial (std::vector< K > &&coefficients)
 Create from list of coefficients. More...
 
 Polynomial (const std::vector< K > &coefficients)
 Create from list of coefficients. More...
 
operator() (const K &x) const
 Evaluate polynomial. More...
 
const std::vector< K > & coefficients () const
 Obtain reference to coefficient vector. More...
 

Friends

Polynomial derivative (const Polynomial &p)
 Obtain derivative of Polynomial function. More...
 

Detailed Description

template<class K>
class Dune::Functions::Polynomial< K >

A scalar polynomial implementation.

Template Parameters
KScalar type. The polynomial will map K to K

This class exists mainly to demonstrate how to implement the Concept::DifferentiableFunction<Range(Domain), DerivativeTraits> concept.

Constructor & Destructor Documentation

◆ Polynomial() [1/6]

template<class K >
Dune::Functions::Polynomial< K >::Polynomial ( )
default

Default constructor.

◆ Polynomial() [2/6]

template<class K >
Dune::Functions::Polynomial< K >::Polynomial ( const Polynomial< K > &  other)
default

Copy constructor.

◆ Polynomial() [3/6]

template<class K >
Dune::Functions::Polynomial< K >::Polynomial ( Polynomial< K > &&  other)
default

Move constructor.

◆ Polynomial() [4/6]

template<class K >
Dune::Functions::Polynomial< K >::Polynomial ( std::initializer_list< K >  coefficients)
inline

Create from list of coefficients.

Coefficients are ordered in accordance with the corresponding monomial order

◆ Polynomial() [5/6]

template<class K >
Dune::Functions::Polynomial< K >::Polynomial ( std::vector< K > &&  coefficients)
inline

Create from list of coefficients.

Coefficients are ordered in accordance with the corresponding monomial order. This will move the coefficients from the given vector.

◆ Polynomial() [6/6]

template<class K >
Dune::Functions::Polynomial< K >::Polynomial ( const std::vector< K > &  coefficients)
inline

Create from list of coefficients.

Coefficients are ordered in accordance with the corresponding monomial order. This will copy coefficients from the given vector.

Member Function Documentation

◆ coefficients()

template<class K >
const std::vector< K > & Dune::Functions::Polynomial< K >::coefficients ( ) const
inline

Obtain reference to coefficient vector.

◆ operator()()

template<class K >
K Dune::Functions::Polynomial< K >::operator() ( const K &  x) const
inline

Evaluate polynomial.

◆ operator=() [1/2]

template<class K >
Polynomial & Dune::Functions::Polynomial< K >::operator= ( const Polynomial< K > &  other)
default

Copy-assignment operator.

◆ operator=() [2/2]

template<class K >
Polynomial & Dune::Functions::Polynomial< K >::operator= ( Polynomial< K > &&  other)
default

Move-assignment operator.


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