SSJ  3.3.1
Stochastic Simulation in Java
Public Member Functions | Package Attributes | List of all members
ShiftedMathFunction Class Reference

Represents a function computing \(f(x) - \delta\) for a user-defined function \(f(x)\) and shift \(\delta\). More...

Inheritance diagram for ShiftedMathFunction:
[legend]
Collaboration diagram for ShiftedMathFunction:
[legend]

Public Member Functions

 ShiftedMathFunction (MathFunction func, double delta)
 Constructs a new function shifting the function func by a shift delta. More...
 
MathFunction getFunction ()
 Returns the function \(f(x)\). More...
 
double getDelta ()
 Returns the shift \(\delta\) = delta. More...
 
double evaluate (double x)
 Returns the value of the function evaluated at \(x\). More...
 
double derivative (double x)
 Computes (or estimates) the first derivative of the function at point x. More...
 
double derivative (double x, int n)
 Computes (or estimates) the \(n\)th derivative of the function at point x. More...
 
double integral (double a, double b)
 Computes (or estimates) the integral of the function over the interval \([a, b]\). More...
 

Package Attributes

MathFunction func
 
double delta
 

Detailed Description

Represents a function computing \(f(x) - \delta\) for a user-defined function \(f(x)\) and shift \(\delta\).

Constructor & Destructor Documentation

◆ ShiftedMathFunction()

ShiftedMathFunction ( MathFunction  func,
double  delta 
)

Constructs a new function shifting the function func by a shift delta.

Parameters
functhe function.
deltathe shift.

Member Function Documentation

◆ derivative() [1/2]

double derivative ( double  x)

Computes (or estimates) the first derivative of the function at point x.

Parameters
xthe point to evaluate the derivative to.
Returns
the value of the derivative.

Implements MathFunctionWithFirstDerivative.

◆ derivative() [2/2]

double derivative ( double  x,
int  n 
)

Computes (or estimates) the \(n\)th derivative of the function at point x.

For \(n=0\), this returns the result of umontreal.ssj.functions.MathFunction.evaluate(double).

Parameters
xthe point to evaluate the derivate to.
nthe order of the derivative.
Returns
the resulting derivative.
Exceptions
IllegalArgumentExceptionif n is negative or 0.

Implements MathFunctionWithDerivative.

◆ evaluate()

double evaluate ( double  x)

Returns the value of the function evaluated at \(x\).

Parameters
xvalue at which the function is evaluated
Returns
function evaluated at x

Implements MathFunction.

◆ getDelta()

double getDelta ( )

Returns the shift \(\delta\) = delta.

Returns
the shift.

◆ getFunction()

MathFunction getFunction ( )

Returns the function \(f(x)\).

Returns
the function.

◆ integral()

double integral ( double  a,
double  b 
)

Computes (or estimates) the integral of the function over the interval \([a, b]\).

Parameters
athe starting point of the interval.
bthe ending point of the interval.
Returns
the value of the integral.

Implements MathFunctionWithIntegral.


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