umontreal.iro.lecuyer.functions
Class PiecewiseConstantFunction
- java.lang.Object
-
- umontreal.iro.lecuyer.functions.PiecewiseConstantFunction
-
- All Implemented Interfaces:
- MathFunction
public class PiecewiseConstantFunction extends java.lang.Object implements MathFunction
Represents a piecewise-constant function.
-
-
Constructor Summary
Constructors Constructor and Description PiecewiseConstantFunction(double[] x, double[] y)Constructs a new piecewise-constant function with X and Y coordinates given by x and y.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doubleevaluate(double x)Returns the value of the function evaluated at x.double[]getX()Returns the X coordinates of the function.double[]getY()Returns the Y coordinates of the function.
-
-
-
Constructor Detail
-
PiecewiseConstantFunction
public PiecewiseConstantFunction(double[] x, double[] y)Constructs a new piecewise-constant function with X and Y coordinates given by x and y.- Parameters:
x- the X coordinates.y- the Y coordinates.
-
-
Method Detail
-
getX
public double[] getX()
Returns the X coordinates of the function.- Returns:
- the X coordinates of the function.
-
getY
public double[] getY()
Returns the Y coordinates of the function.- Returns:
- the Y coordinates of the function.
-
evaluate
public double evaluate(double x)
Description copied from interface:MathFunctionReturns the value of the function evaluated at x.- Specified by:
evaluatein interfaceMathFunction- Parameters:
x- value at which the distribution function is evaluated- Returns:
- function evaluated at x
-
-
DMelt 3.0 © DataMelt by jWork.ORG