Public Member Functions | List of all members
PLMD::lepton::CustomFunction Class Referenceabstract

This class is the interface for defining your own function that may be included in expressions. More...

#include <CustomFunction.h>

Inheritance diagram for PLMD::lepton::CustomFunction:
Inheritance graph
[legend]

Public Member Functions

virtual ~CustomFunction ()
 
virtual CustomFunctionclone () const =0
 Create a new duplicate of this object on the heap using the "new" operator. More...
 
virtual double evaluate (const double *arguments) const =0
 Evaluate the function. More...
 
virtual double evaluateDerivative (const double *arguments, const int *derivOrder) const =0
 Evaluate a derivative of the function. More...
 
virtual int getNumArguments () const =0
 Get the number of arguments this function expects. More...
 

Detailed Description

This class is the interface for defining your own function that may be included in expressions.

To use it, create a concrete subclass that implements all of the virtual methods for each new function you want to define. Then when you call Parser::parse() to parse an expression, pass a map of function names to CustomFunction objects.

Constructor & Destructor Documentation

◆ ~CustomFunction()

virtual PLMD::lepton::CustomFunction::~CustomFunction ( )
inlinevirtual

Member Function Documentation

◆ clone()

virtual CustomFunction* PLMD::lepton::CustomFunction::clone ( ) const
pure virtual

Create a new duplicate of this object on the heap using the "new" operator.

Implemented in PLMD::lepton::PlaceholderFunction.

◆ evaluate()

virtual double PLMD::lepton::CustomFunction::evaluate ( const double *  arguments) const
pure virtual

Evaluate the function.

Parameters
argumentsthe array of argument values

Implemented in PLMD::lepton::PlaceholderFunction.

◆ evaluateDerivative()

virtual double PLMD::lepton::CustomFunction::evaluateDerivative ( const double *  arguments,
const int *  derivOrder 
) const
pure virtual

Evaluate a derivative of the function.

Parameters
argumentsthe array of argument values
derivOrderan array specifying the number of times the function has been differentiated with respect to each of its arguments. For example, the array {0, 2} indicates a second derivative with respect to the second argument.

Implemented in PLMD::lepton::PlaceholderFunction.

◆ getNumArguments()

virtual int PLMD::lepton::CustomFunction::getNumArguments ( ) const
pure virtual

Get the number of arguments this function expects.

Implemented in PLMD::lepton::PlaceholderFunction.


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