@CodeReview(reviewer="Justin Basilico", date="2006-10-05", changesNeeded=false, comments="Class looks fine.") public class LinearVectorFunction extends AbstractCloneableSerializable implements DifferentiableVectorFunction
LinearFunction
class is a simple
VectorFunction
that just scales the given input vector by a
scalar value.Modifier and Type | Field and Description |
---|---|
static double |
DEFAULT_SCALE_FACTOR
Scale factor for default constructor, 1.0.
|
Constructor and Description |
---|
LinearVectorFunction()
Creates a new instance of LinearVectorFunction
with the default scale factor.
|
LinearVectorFunction(double scaleFactor)
Creates a new instance of LinearFunction.
|
Modifier and Type | Method and Description |
---|---|
Matrix |
differentiate(Vector input)
Differentiate the VectorFunction at
input and return
the Jacobian |
Vector |
evaluate(Vector input)
Evaluates the function on the given input and returns the output.
|
double |
getScaleFactor()
Gets the linear scale factor.
|
void |
setScaleFactor(double scaleFactor)
Sets the linear scale factor.
|
clone
public static final double DEFAULT_SCALE_FACTOR
public LinearVectorFunction()
public LinearVectorFunction(double scaleFactor)
scaleFactor
- The amount to scale.public double getScaleFactor()
public void setScaleFactor(double scaleFactor)
scaleFactor
- The scale factor.public Vector evaluate(Vector input)
Evaluator
public Matrix differentiate(Vector input)
DifferentiableVectorFunction
input
and return
the Jacobiandifferentiate
in interface DifferentiableEvaluator<Vector,Vector,Matrix>
differentiate
in interface DifferentiableVectorFunction
input
- Vector input to the VectorFunction, about which to evaluate
the VectorFunctioninput