public class CustomSparseVectorFactory extends VectorFactory<SparseVector>
Modifier and Type | Field and Description |
---|---|
static CustomSparseVectorFactory |
INSTANCE
An instance of this class.
|
DEFAULT_DENSE_INSTANCE, DEFAULT_SPARSE_INSTANCE
Constructor and Description |
---|
CustomSparseVectorFactory() |
Modifier and Type | Method and Description |
---|---|
SparseVector |
copyVector(Vector m)
Creates a deep copy new Vector given another, argument is unchanged
|
SparseVector |
createVector(int dim)
Creates an empty Vector of the specified dimension, all elements
must be all zeros!
|
Vector1D |
createVector1D(double x)
Creates a one-dimensional vector with the given x coordinate: (x).
|
Vector2D |
createVector2D(double x,
double y)
Creates a two-dimensional vector with the given x and y coordinates:
(x, y).
|
Vector3D |
createVector3D(double x,
double y,
double z)
Creates a three-dimensional vector with the given x, y, and z
coordinates: (x, y, z).
|
SparseVector |
createVectorCapacity(int dimensionality,
int initialCapacity)
Creates a new, empty vector with the given dimensionality and expected
number of nonzero elements.
|
MatrixFactory<?> |
getAssociatedMatrixFactory()
Gets the matrix factory implementation associated with this vector
factory.
|
copyArray, copyArray, copyMap, copyValues, copyValues, createGaussianRandom, createUniformRandom, createUniformRandom, createVector, createVector1D, createVector2D, createVector3D, getDefault, getDenseDefault, getSparseDefault
public static CustomSparseVectorFactory INSTANCE
public final SparseVector copyVector(Vector m)
VectorFactory
copyVector
in class VectorFactory<SparseVector>
m
- Vector to copypublic final SparseVector createVector(int dim)
VectorFactory
createVector
in class VectorFactory<SparseVector>
dim
- number of elements in the Vectorpublic final Vector1D createVector1D(double x)
createVector1D
in class VectorFactory<SparseVector>
x
- The x coordinate.public final Vector2D createVector2D(double x, double y)
createVector2D
in class VectorFactory<SparseVector>
x
- The x coordinate.y
- The y coordinate.public final Vector3D createVector3D(double x, double y, double z)
createVector3D
in class VectorFactory<SparseVector>
x
- The x coordinate.y
- The y coordinate.z
- The z coordinate.public MatrixFactory<?> getAssociatedMatrixFactory()
VectorFactory
getAssociatedMatrixFactory
in class VectorFactory<SparseVector>
public SparseVector createVectorCapacity(int dimensionality, int initialCapacity)
VectorFactory
createVectorCapacity
in class VectorFactory<SparseVector>
dimensionality
- The dimensionality for the vector to create.initialCapacity
- The expected initial number of nonzero elements of the vector to
create.