KrisLibrary  1.0.0
Public Member Functions | List of all members
Math::RealFunction Class Referenceabstract

A function from R to R. More...

#include <function.h>

Inheritance diagram for Math::RealFunction:
Math::AddFunction Math::ComposeFunction Math::InverseFunction Math::LinearFunction Math::MulFunction Math::ScalarFieldDirectionalFunction Math::ScalarFieldProjectionFunction RotationAngleFunction

Public Member Functions

virtual std::string Label () const
 
virtual std::string VariableLabel () const
 
virtual Real operator() (Real t)
 
virtual void PreEval (Real t)
 
virtual Real Eval (Real t)=0
 
virtual Real Deriv (Real t)
 
virtual Real Deriv2 (Real t)
 

Detailed Description

A function from R to R.

Subclasses of RealFunction must overload Eval(), and optionally overload Deriv() and Deriv2() (first and second derivatives).

NOTE: PreEval(x) MUST be called before evaluating the function value or derivatives using Eval(x), Deriv(x), or Deriv2(x).

PreEval() allows reducing the number of computations when Eval() and Deriv() share some intermediate lengthy computation `Z'. `Z' can be computed and cached from PreEval(), and then reused when Eval() or Deriv.

y=f(x) can be used as a shorthand for f.PreEval(x); y=f.Eval(x).


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