gov.sandia.cognition.learning.function.vector
Class LinearVectorFunction

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.learning.function.vector.LinearVectorFunction
All Implemented Interfaces:
Evaluator<Vector,Vector>, DifferentiableEvaluator<Vector,Vector,Matrix>, DifferentiableVectorFunction, VectorFunction, CloneableSerializable, Serializable, Cloneable

@CodeReview(reviewer="Justin Basilico",
            date="2006-10-05",
            changesNeeded=false,
            comments="Class looks fine.")
public class LinearVectorFunction
extends AbstractCloneableSerializable
implements DifferentiableVectorFunction

The LinearFunction class is a simple VectorFunction that just scales the given input vector by a scalar value.

Since:
1.0
Author:
Kevin R. Dixon
See Also:
Serialized Form

Field Summary
static double DEFAULT_SCALE_FACTOR
          Scale factor for default constructor, 1.0.
 
Constructor Summary
LinearVectorFunction()
          Creates a new instance of LinearVectorFunction with the default scale factor.
LinearVectorFunction(double scaleFactor)
          Creates a new instance of LinearFunction.
 
Method Summary
 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.
 
Methods inherited from class gov.sandia.cognition.util.AbstractCloneableSerializable
clone
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface gov.sandia.cognition.util.CloneableSerializable
clone
 

Field Detail

DEFAULT_SCALE_FACTOR

public static final double DEFAULT_SCALE_FACTOR
Scale factor for default constructor, 1.0.

See Also:
Constant Field Values
Constructor Detail

LinearVectorFunction

public LinearVectorFunction()
Creates a new instance of LinearVectorFunction with the default scale factor.


LinearVectorFunction

public LinearVectorFunction(double scaleFactor)
Creates a new instance of LinearFunction.

Parameters:
scaleFactor - The amount to scale.
Method Detail

getScaleFactor

public double getScaleFactor()
Gets the linear scale factor.

Returns:
The linear scale factor.

setScaleFactor

public void setScaleFactor(double scaleFactor)
Sets the linear scale factor.

Parameters:
scaleFactor - The scale factor.

evaluate

public Vector evaluate(Vector input)
Description copied from interface: Evaluator
Evaluates the function on the given input and returns the output.

Specified by:
evaluate in interface Evaluator<Vector,Vector>
Parameters:
input - The input to evaluate.
Returns:
The output produced by evaluating the input.

differentiate

public Matrix differentiate(Vector input)
Description copied from interface: DifferentiableVectorFunction
Differentiate the VectorFunction at input and return the Jacobian

Specified by:
differentiate in interface DifferentiableEvaluator<Vector,Vector,Matrix>
Specified by:
differentiate in interface DifferentiableVectorFunction
Parameters:
input - Vector input to the VectorFunction, about which to evaluate the VectorFunction
Returns:
Jacobian at input