Flow123d  JS_before_hm-2154-g185f171e0
Public Member Functions | List of all members
FunctorBase< Type > Class Template Referenceabstract

Abstract templated explicit functor class. More...

#include <adaptivesimpson.hh>

Public Member Functions

 FunctorBase ()
 Constructor. More...
 
virtual ~FunctorBase ()
 Destructor. More...
 
virtual Type operator() (Type x)=0
 Virtual operator () with type Type. More...
 

Detailed Description

template<class Type>
class FunctorBase< Type >

Abstract templated explicit functor class.

This class represents an explicit functor. Actual non-abstract functor is obtained by deriving from this class and overriding the operator(). Parameters can be set and used by the methods of ancestor class FunctorCommon.

The template is used to enable computing derivates by FADBAD++ library. The virtual operator() needs to operate both with type double and FADBAD++ types, such as B<double> and T<double>.

Simple usage example for function $ x^3p_1+\frac{p_2}{p_3} $ with three parameters:

template<class Type=double>
class Cubic : public FunctorBase<Type>
{
public:
typedef enum{ p1, p2, p3
} Parameters;
Cubic(double pp1, double pp2, double pp3)
{
this->set_param(p1, pp1);
this->set_param(p2, pp2);
this->set_param(p3, pp3);
}
Type operator()(Type x)
{
return x*x*x * this->param(p1) + this->param(p2)/this->param(p3);
}
};

Definition at line 21 of file adaptivesimpson.hh.

Constructor & Destructor Documentation

◆ FunctorBase()

template<class Type >
FunctorBase< Type >::FunctorBase

Constructor.

Definition at line 70 of file functors_impl.hh.

◆ ~FunctorBase()

template<class Type >
FunctorBase< Type >::~FunctorBase
virtual

Destructor.

Definition at line 73 of file functors_impl.hh.

Member Function Documentation

◆ operator()()

template<class Type >
virtual Type FunctorBase< Type >::operator() ( Type  x)
pure virtual

Virtual operator () with type Type.

Implemented in Interpolant::FuncError_wp1, and Interpolant::FuncError_lp.


The documentation for this class was generated from the following files:
FunctorBase::operator()
virtual Type operator()(Type x)=0
Virtual operator () with type Type.
FunctorBase
Abstract templated explicit functor class.
Definition: adaptivesimpson.hh:21