SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
umontreal.ssj.functions.ShiftedMathFunction Class Reference

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

Inheritance diagram for umontreal.ssj.functions.ShiftedMathFunction:
umontreal.ssj.functions.MathFunction umontreal.ssj.functions.MathFunctionWithFirstDerivative umontreal.ssj.functions.MathFunctionWithDerivative umontreal.ssj.functions.MathFunctionWithIntegral umontreal.ssj.functions.MathFunction umontreal.ssj.functions.MathFunction umontreal.ssj.functions.MathFunction

Public Member Functions

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

Detailed Description

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

Definition at line 33 of file ShiftedMathFunction.java.

Constructor & Destructor Documentation

◆ ShiftedMathFunction()

umontreal.ssj.functions.ShiftedMathFunction.ShiftedMathFunction ( MathFunction func,
double delta )

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

Parameters
functhe function.
deltathe shift.

Definition at line 45 of file ShiftedMathFunction.java.

Member Function Documentation

◆ derivative() [1/2]

double umontreal.ssj.functions.ShiftedMathFunction.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 umontreal.ssj.functions.MathFunctionWithFirstDerivative.

Definition at line 74 of file ShiftedMathFunction.java.

◆ derivative() [2/2]

double umontreal.ssj.functions.ShiftedMathFunction.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 umontreal.ssj.functions.MathFunctionWithDerivative.

Definition at line 78 of file ShiftedMathFunction.java.

◆ evaluate()

double umontreal.ssj.functions.ShiftedMathFunction.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 umontreal.ssj.functions.MathFunction.

Definition at line 70 of file ShiftedMathFunction.java.

◆ getDelta()

double umontreal.ssj.functions.ShiftedMathFunction.getDelta ( )

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

Returns
the shift.

Definition at line 66 of file ShiftedMathFunction.java.

◆ getFunction()

MathFunction umontreal.ssj.functions.ShiftedMathFunction.getFunction ( )

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

Returns
the function.

Definition at line 57 of file ShiftedMathFunction.java.

◆ integral()

double umontreal.ssj.functions.ShiftedMathFunction.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 umontreal.ssj.functions.MathFunctionWithIntegral.

Definition at line 82 of file ShiftedMathFunction.java.


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