public class DenseVectorFactoryMTJ extends VectorFactory<DenseVector>
Modifier and Type | Field and Description |
---|---|
static DenseVectorFactoryMTJ |
INSTANCE
Default instance of this
|
DEFAULT_DENSE_INSTANCE, DEFAULT_SPARSE_INSTANCE
Constructor and Description |
---|
DenseVectorFactoryMTJ()
Creates a new instance of DenseVectorFactoryMTJ
|
Modifier and Type | Method and Description |
---|---|
DenseVector |
copyArray(double[] values)
Creates a DenseVector based on the given array values.
|
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!
|
DenseVector |
createVector(int dimensionality,
double initialValue)
Creates a Vector with the given initial value for all elements.
|
Vector1D |
createVector1D(double x)
Creates a one-dimensional vector with the given x coordinate: (x).
|
Vector2 |
createVector2D(double x,
double y)
Creates a two-dimensional vector with the given x and y coordinates:
(x, y).
|
Vector3 |
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.
|
DenseVector |
createWrapper(no.uib.cipr.matrix.DenseVector internalVector)
Creates a new wrapper for a dense MTJ vector.
|
MatrixFactory<?> |
getAssociatedMatrixFactory()
Gets the matrix factory implementation associated with this vector
factory.
|
copyArray, copyMap, copyValues, copyValues, createGaussianRandom, createUniformRandom, createUniformRandom, createVector1D, createVector2D, createVector3D, getDefault, getDenseDefault, getSparseDefault
public static final DenseVectorFactoryMTJ INSTANCE
public DenseVectorFactoryMTJ()
public DenseVector copyVector(Vector m)
VectorFactory
copyVector
in class VectorFactory<DenseVector>
m
- Vector to copypublic DenseVector createVector(int dim)
VectorFactory
createVector
in class VectorFactory<DenseVector>
dim
- number of elements in the Vectorpublic DenseVector copyArray(double[] values)
copyArray
in class VectorFactory<DenseVector>
values
- Array to create the Vector based upon. Reused in the Vectorpublic DenseVector createVector(int dimensionality, double initialValue)
VectorFactory
createVector
in class VectorFactory<DenseVector>
dimensionality
- The number of elements for the vector.initialValue
- Initial value to set all elements topublic Vector1D createVector1D(double x)
VectorFactory
createVector1D
in class VectorFactory<DenseVector>
x
- The x coordinate.public Vector2 createVector2D(double x, double y)
VectorFactory
createVector2D
in class VectorFactory<DenseVector>
x
- The x coordinate.y
- The y coordinate.public Vector3 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 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.public DenseVector createWrapper(no.uib.cipr.matrix.DenseVector internalVector)
internalVector
- The MTJ vector to wrap.public MatrixFactory<?> getAssociatedMatrixFactory()
VectorFactory
getAssociatedMatrixFactory
in class VectorFactory<DenseVector>