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

java.lang.Object
  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.learning.function.LinearCombinationFunction<Vector,Vector>
          extended by gov.sandia.cognition.learning.function.vector.LinearCombinationVectorFunction
All Implemented Interfaces:
Evaluator<Vector,Vector>, VectorFunction, Vectorizable, CloneableSerializable, Serializable, Cloneable

public class LinearCombinationVectorFunction
extends LinearCombinationFunction<Vector,Vector>
implements VectorFunction

A weighted linear combination of scalar functions.

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

Constructor Summary
LinearCombinationVectorFunction(ArrayList<? extends Evaluator<? super Vector,? extends Vector>> basisFunctions, Vector coefficients)
          Creates a new instance of LinearCombinationFunction
LinearCombinationVectorFunction(Collection<? extends Evaluator<? super Vector,? extends Vector>> basisFunctions)
          Creates a new instance of LinearCombinationFunction
LinearCombinationVectorFunction(VectorFunction... basisFunctions)
          Creates a new instance of LinearCombinationFunction
 
Method Summary
 LinearCombinationVectorFunction clone()
          This makes public the clone method on the Object class and removes the exception that it throws.
 Vector evaluate(Vector input)
          Evaluates the LinearCombinationFunction about the given input.
 
Methods inherited from class gov.sandia.cognition.learning.function.LinearCombinationFunction
convertFromVector, convertToVector, getBasisFunctions, getCoefficients, setBasisFunctions, setCoefficients, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

LinearCombinationVectorFunction

public LinearCombinationVectorFunction(VectorFunction... basisFunctions)
Creates a new instance of LinearCombinationFunction

Parameters:
basisFunctions - Collection of basis functions to combine to produce the output

LinearCombinationVectorFunction

public LinearCombinationVectorFunction(Collection<? extends Evaluator<? super Vector,? extends Vector>> basisFunctions)
Creates a new instance of LinearCombinationFunction

Parameters:
basisFunctions - Collection of basis functions to combine to produce the output

LinearCombinationVectorFunction

public LinearCombinationVectorFunction(ArrayList<? extends Evaluator<? super Vector,? extends Vector>> basisFunctions,
                                       Vector coefficients)
Creates a new instance of LinearCombinationFunction

Parameters:
basisFunctions - Collection of basis functions to combine to produce the output
coefficients - Coefficients for the basisFunctions
Method Detail

clone

public LinearCombinationVectorFunction clone()
Description copied from class: AbstractCloneableSerializable
This makes public the clone method on the Object class and removes the exception that it throws. Its default behavior is to automatically create a clone of the exact type of object that the clone is called on and to copy all primitives but to keep all references, which means it is a shallow copy. Extensions of this class may want to override this method (but call super.clone() to implement a "smart copy". That is, to target the most common use case for creating a copy of the object. Because of the default behavior being a shallow copy, extending classes only need to handle fields that need to have a deeper copy (or those that need to be reset). Some of the methods in ObjectUtil may be helpful in implementing a custom clone method. Note: The contract of this method is that you must use super.clone() as the basis for your implementation.

Specified by:
clone in interface Vectorizable
Specified by:
clone in interface CloneableSerializable
Overrides:
clone in class LinearCombinationFunction<Vector,Vector>
Returns:
A clone of this object.

evaluate

public Vector evaluate(Vector input)
Description copied from class: LinearCombinationFunction
Evaluates the LinearCombinationFunction about the given input. The output is produced as: y = a0*f0(x) + a1*f1(x) + ... + an*fn(x), where "y" is the output, "x" is the given input, "ai" is the ith coefficient and "fi" is the ith basis function

Specified by:
evaluate in interface Evaluator<Vector,Vector>
Specified by:
evaluate in class LinearCombinationFunction<Vector,Vector>
Parameters:
input - The input about which to compute the output
Returns:
y = a0*f0(x) + a1*f1(x) + ... + an*fn(x)