public class CustomDenseVectorFactory extends VectorFactory<DenseVector>
Modifier and Type | Field and Description |
---|---|
static CustomDenseVectorFactory |
INSTANCE
An instance of this class.
|
DEFAULT_DENSE_INSTANCE, DEFAULT_SPARSE_INSTANCE
Constructor and Description |
---|
CustomDenseVectorFactory() |
Modifier and Type | Method and Description |
---|---|
DenseVector |
copyVector(Vector m)
Creates a deep copy new Vector given another, argument is unchanged
|
DenseVector |
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).
|
DenseVector |
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 CustomDenseVectorFactory INSTANCE
public final DenseVector copyVector(Vector m)
VectorFactory
copyVector
in class VectorFactory<DenseVector>
m
- Vector to copypublic final DenseVector createVector(int dim)
VectorFactory
createVector
in class VectorFactory<DenseVector>
dim
- number of elements in the Vectorpublic final Vector1D createVector1D(double x)
VectorFactory
createVector1D
in class VectorFactory<DenseVector>
x
- The x coordinate.public final Vector2D createVector2D(double x, double y)
VectorFactory
createVector2D
in class VectorFactory<DenseVector>
x
- The x coordinate.y
- The y coordinate.public final Vector3D createVector3D(double x, double y, double z)
VectorFactory
createVector3D
in class VectorFactory<DenseVector>
x
- The x coordinate.y
- The y coordinate.z
- The z coordinate.public MatrixFactory<?> getAssociatedMatrixFactory()
VectorFactory
getAssociatedMatrixFactory
in class VectorFactory<DenseVector>
public DenseVector createVectorCapacity(int dimensionality, int initialCapacity)
VectorFactory
createVectorCapacity
in class VectorFactory<DenseVector>
dimensionality
- The dimensionality for the vector to create.initialCapacity
- The expected initial number of nonzero elements of the vector to
create.