public class PiecewiseLinearFunction extends FunctionBase
Constructor and Description |
---|
PiecewiseLinearFunction() |
PiecewiseLinearFunction(double[] x,
double[] y) |
Modifier and Type | Method and Description |
---|---|
PiecewiseLinearFunction |
clone() |
double |
eval(VectorNd x)
Evaluates the function at the given input value
|
void |
evalDeriv(VectorNd x,
VectorNd df)
Evaluates the function derivative at the given input value
|
LinearSpline1d |
getFunction() |
void |
set(double[] x,
double[] y)
Sets the knot locations
|
double |
solveForNearestX(double fx,
double x,
double eps) |
int |
solveForX(double y,
java.util.List<java.lang.Double> x,
double eps) |
public PiecewiseLinearFunction()
public PiecewiseLinearFunction(double[] x, double[] y)
public void set(double[] x, double[] y)
x
- x locationy
- locationpublic double eval(VectorNd x)
FunctionBase
eval
in class FunctionBase
public void evalDeriv(VectorNd x, VectorNd df)
FunctionBase
evalDeriv
in class FunctionBase
public LinearSpline1d getFunction()
getFunction
in class FunctionBase
public int solveForX(double y, java.util.List<java.lang.Double> x, double eps)
public double solveForNearestX(double fx, double x, double eps)
public PiecewiseLinearFunction clone()
clone
in interface Clonable
clone
in class FunctionBase