gov.sandia.cognition.math.matrix
Class SparseVectorFactory<VectorType extends Vector>
java.lang.Object
gov.sandia.cognition.math.matrix.VectorFactory<VectorType>
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
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 |
SparseVectorFactory
public SparseVectorFactory()
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.