Public Member Functions | Private Attributes | List of all members
PLMD::lepton::PlaceholderFunction Class Reference

This class is an implementation of CustomFunction that does no computation. More...

#include <CustomFunction.h>

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

Public Member Functions

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

Private Attributes

int numArgs
 

Detailed Description

This class is an implementation of CustomFunction that does no computation.

It just returns 0 for the value and derivatives. This is useful when using the parser to analyze expressions rather than to evaluate them. You can just create PlaceholderFunctions to represent any custom functions that may appear in expressions.

Constructor & Destructor Documentation

◆ PlaceholderFunction()

PLMD::lepton::PlaceholderFunction::PlaceholderFunction ( int  numArgs)
inline

Create a Placeholder function.

Parameters
numArgsthe number of arguments the function expects

Member Function Documentation

◆ clone()

CustomFunction* PLMD::lepton::PlaceholderFunction::clone ( ) const
inlinevirtual

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

Implements PLMD::lepton::CustomFunction.

◆ evaluate()

double PLMD::lepton::PlaceholderFunction::evaluate ( const double *  arguments) const
inlinevirtual

Evaluate the function.

Parameters
argumentsthe array of argument values

Implements PLMD::lepton::CustomFunction.

◆ evaluateDerivative()

double PLMD::lepton::PlaceholderFunction::evaluateDerivative ( const double *  arguments,
const int *  derivOrder 
) const
inlinevirtual

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.

Implements PLMD::lepton::CustomFunction.

◆ getNumArguments()

int PLMD::lepton::PlaceholderFunction::getNumArguments ( ) const
inlinevirtual

Get the number of arguments this function expects.

Implements PLMD::lepton::CustomFunction.

Member Data Documentation

◆ numArgs

int PLMD::lepton::PlaceholderFunction::numArgs
private

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