public class ConstantFunction extends java.lang.Object implements Function
Constructor and Description |
---|
ConstantFunction(int dimension,
float value) |
Modifier and Type | Method and Description |
---|---|
Function |
clone() |
int |
getDimension() |
float |
getValue() |
float |
map(float[] from) |
float[] |
multiMap(float[][] from) |
void |
setDimension(int dimension) |
void |
setValue(float value) |
public ConstantFunction(int dimension, float value)
dimension
- Input dimension of this Functionvalue
- Constant output value of this Functionpublic void setValue(float value)
value
- The new constant result of the functionpublic void setDimension(int dimension)
dimension
- New dimensionpublic int getDimension()
getDimension
in interface Function
Function.getDimension()
public float map(float[] from)
map
in interface Function
from
- Must have same length as getDimension()Function.map(float[])
public float[] multiMap(float[][] from)
multiMap
in interface Function
from
- An array of arguments; each element must have length getDimension().Function.multiMap(float[][])
public float getValue()