gov.sandia.cognition.math.matrix
Class SparseVectorFactory<VectorType extends Vector>

java.lang.Object
  extended by gov.sandia.cognition.math.matrix.VectorFactory<VectorType>
      extended by gov.sandia.cognition.math.matrix.SparseVectorFactory<VectorType>
Type Parameters:
VectorType - Type of Vector created by the VectorFactory.
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
SparseVectorFactoryMTJ

public abstract class SparseVectorFactory<VectorType extends Vector>
extends VectorFactory<VectorType>

Abstract factory class for creating sparse vectors.

Since:
3.0
Author:
Justin Basilico
See Also:
Serialized Form

Field Summary
 
Fields inherited from class gov.sandia.cognition.math.matrix.VectorFactory
DEFAULT_DENSE_INSTANCE, DEFAULT_SPARSE_INSTANCE
 
Constructor Summary
SparseVectorFactory()
           
 
Method Summary
abstract  VectorType createVectorCapacity(int dimensionality, int initialCapacity)
          Creates a new, empty vector with the given dimensionality and expected number of nonzero elements.
static SparseVectorFactory<? extends Vector> getDefault()
          Gets the default instance.
 
Methods inherited from class gov.sandia.cognition.math.matrix.VectorFactory
copyArray, copyArray, copyValues, copyValues, copyVector, createUniformRandom, createVector, createVector, createVector1D, createVector1D, createVector2D, createVector2D, createVector3D, createVector3D, getDenseDefault, getSparseDefault
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SparseVectorFactory

public SparseVectorFactory()
Method Detail

getDefault

public static SparseVectorFactory<? extends Vector> getDefault()
Gets the default instance.

Returns:
Default instance of the SparseVectorFactory

createVectorCapacity

public abstract VectorType createVectorCapacity(int dimensionality,
                                                int initialCapacity)
Creates a new, empty vector with the given dimensionality and expected number of nonzero elements.

Parameters:
dimensionality - The dimensionality for the vector to create.
initialCapacity - The expected initial number of nonzero elements of the vector to create.
Returns:
A new sparse vector with the given dimensionality and number of nonzeros.