PARTONS/NumA++  
Numerical Analysis C++ routines
Public Member Functions | Private Member Functions | Private Attributes | List of all members
NumA::FunctorMD< PointerToObj, PointerToFunc > Class Template Reference

Template class for defining multi-dimensional functions that can be used as arguments in virtual methods. More...

Inheritance diagram for NumA::FunctorMD< PointerToObj, PointerToFunc >:
NumA::FunctionTypeMD

Public Member Functions

 FunctorMD (PointerToObj *object, PointerToFunc function)
 Constructor. More...
 
virtual ~FunctorMD ()
 Default destructor. More...
 
double operator() (VectorD &variables, std::vector< double > &parameters)
 Operator allowing the functor to be used as a function. More...
 
double operator() (VectorD &variables)
 Operator allowing the functor to be used as a function. More...
 
- Public Member Functions inherited from NumA::FunctionTypeMD
 FunctionTypeMD ()
 Empty constructor. More...
 
virtual ~FunctionTypeMD ()
 Default destructor. More...
 

Private Member Functions

 FunctorMD (const FunctorMD &)
 Not implemented. Disallows copy. More...
 
FunctorMDoperator= (const FunctorMD &)
 Not implemented. Disallows comparisons. More...
 

Private Attributes

PointerToObj * m_pObject
 Pointer to an object instantiating the class where the function is defined. More...
 
PointerToFunc m_pFunction
 Reference to the function. More...
 

Detailed Description

template<typename PointerToObj, typename PointerToFunc>
class NumA::FunctorMD< PointerToObj, PointerToFunc >

Template class for defining multi-dimensional functions that can be used as arguments in virtual methods.

This is needed to circumvent the issue that templates and virtual methods are incompatible.

See FunctionTypeMD documentation for usage.

Constructor & Destructor Documentation

◆ FunctorMD() [1/2]

template<typename PointerToObj , typename PointerToFunc >
NumA::FunctorMD< PointerToObj, PointerToFunc >::FunctorMD ( PointerToObj *  object,
PointerToFunc  function 
)
inline

Constructor.

Parameters
objectPointer to an object instantiating the class where the function is defined.
functionReference to the function.

◆ ~FunctorMD()

template<typename PointerToObj , typename PointerToFunc >
virtual NumA::FunctorMD< PointerToObj, PointerToFunc >::~FunctorMD ( )
inlinevirtual

Default destructor.

◆ FunctorMD() [2/2]

template<typename PointerToObj , typename PointerToFunc >
NumA::FunctorMD< PointerToObj, PointerToFunc >::FunctorMD ( const FunctorMD< PointerToObj, PointerToFunc > &  )
private

Not implemented. Disallows copy.

Member Function Documentation

◆ operator()() [1/2]

template<typename PointerToObj , typename PointerToFunc >
double NumA::FunctorMD< PointerToObj, PointerToFunc >::operator() ( VectorD variables)
inlinevirtual

Operator allowing the functor to be used as a function.

Parameters
variablesMulti-variate argument of the function represented by the functor.
Returns
double

Implements NumA::FunctionTypeMD.

◆ operator()() [2/2]

template<typename PointerToObj , typename PointerToFunc >
double NumA::FunctorMD< PointerToObj, PointerToFunc >::operator() ( VectorD variables,
std::vector< double > &  parameters 
)
inlinevirtual

Operator allowing the functor to be used as a function.

Parameters
variablesMulti-variate argument of the function represented by the functor.
parametersParameters that can be passed to the function.
Returns
double

Implements NumA::FunctionTypeMD.

◆ operator=()

template<typename PointerToObj , typename PointerToFunc >
FunctorMD& NumA::FunctorMD< PointerToObj, PointerToFunc >::operator= ( const FunctorMD< PointerToObj, PointerToFunc > &  )
private

Not implemented. Disallows comparisons.

Member Data Documentation

◆ m_pFunction

template<typename PointerToObj , typename PointerToFunc >
PointerToFunc NumA::FunctorMD< PointerToObj, PointerToFunc >::m_pFunction
private

Reference to the function.

◆ m_pObject

template<typename PointerToObj , typename PointerToFunc >
PointerToObj* NumA::FunctorMD< PointerToObj, PointerToFunc >::m_pObject
private

Pointer to an object instantiating the class where the function is defined.


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