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

Represents a function computing \((af(x) + b)^2\) for a user-defined function \(f(x)\). More...

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

Public Member Functions

 SquareMathFunction (MathFunction func)
 Constructs a new square function for function func. More...
 
 SquareMathFunction (MathFunction func, double a, double b)
 Constructs a new power function for function func, and constants a and b. More...
 
MathFunction getFunction ()
 Returns the function \(f(x)\). More...
 
double getA ()
 Returns the value of \(a\). More...
 
double getB ()
 Returns the value of \(b\). 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...
 

Package Attributes

double b
 

Detailed Description

Represents a function computing \((af(x) + b)^2\) for a user-defined function \(f(x)\).

Constructor & Destructor Documentation

◆ SquareMathFunction() [1/2]

Constructs a new square function for function func.

The values of the constants are \(a=1\) and \(b=0\).

Parameters
functhe function \(f(x)\).

◆ SquareMathFunction() [2/2]

SquareMathFunction ( MathFunction  func,
double  a,
double  b 
)

Constructs a new power function for function func, and constants a and b.

Parameters
functhe function \(f(x)\).
athe multiplicative constant.
bthe additive constant.

Member Function Documentation

◆ derivative()

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.

◆ 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.

◆ getA()

double getA ( )

Returns the value of \(a\).

Returns
the value of \(a\).

◆ getB()

double getB ( )

Returns the value of \(b\).

Returns
the value of \(b\).

◆ getFunction()

MathFunction getFunction ( )

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

Returns
the function.

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