gov.sandia.cognition.math.matrix.mtj
Class DenseVectorFactoryMTJ

java.lang.Object
  extended by gov.sandia.cognition.math.matrix.VectorFactory<DenseVector>
      extended by gov.sandia.cognition.math.matrix.mtj.DenseVectorFactoryMTJ
All Implemented Interfaces:
Serializable

public class DenseVectorFactoryMTJ
extends VectorFactory<DenseVector>

VectorFactory for MTJ's DenseVector-based Vector

Since:
1.0
Author:
Kevin R. Dixon
See Also:
Serialized Form

Field Summary
static DenseVectorFactoryMTJ INSTANCE
          Default instance of this
 
Fields inherited from class gov.sandia.cognition.math.matrix.VectorFactory
DEFAULT_DENSE_INSTANCE, DEFAULT_SPARSE_INSTANCE
 
Constructor Summary
DenseVectorFactoryMTJ()
          Creates a new instance of DenseVectorFactoryMTJ
 
Method Summary
 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 createWrapper(no.uib.cipr.matrix.DenseVector internalVector)
          Creates a new wrapper for a dense MTJ vector.
 
Methods inherited from class gov.sandia.cognition.math.matrix.VectorFactory
copyArray, copyValues, copyValues, createUniformRandom, createVector1D, createVector2D, createVector3D, getDefault, getDenseDefault, getSparseDefault
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

INSTANCE

public static final DenseVectorFactoryMTJ INSTANCE
Default instance of this

Constructor Detail

DenseVectorFactoryMTJ

public DenseVectorFactoryMTJ()
Creates a new instance of DenseVectorFactoryMTJ

Method Detail

copyVector

public DenseVector copyVector(Vector m)
Description copied from class: VectorFactory
Creates a deep copy new Vector given another, argument is unchanged

Specified by:
copyVector in class VectorFactory<DenseVector>
Parameters:
m - Vector to copy
Returns:
Deep copy of the given Vector

createVector

public DenseVector createVector(int dim)
Description copied from class: VectorFactory
Creates an empty Vector of the specified dimension, all elements must be all zeros!

Specified by:
createVector in class VectorFactory<DenseVector>
Parameters:
dim - number of elements in the Vector
Returns:
A new Vector or the given dimensionality with all zero elements.

copyArray

public DenseVector copyArray(double[] values)
Creates a DenseVector based on the given array values. Note that this method reuses the array and does not make a copy of the elements.

Overrides:
copyArray in class VectorFactory<DenseVector>
Parameters:
values - Array to create the Vector based upon. Reused in the Vector
Returns:
DenseVector based on the double array

createVector

public DenseVector createVector(int dimensionality,
                                double initialValue)
Description copied from class: VectorFactory
Creates a Vector with the given initial value for all elements.

Overrides:
createVector in class VectorFactory<DenseVector>
Parameters:
dimensionality - The number of elements for the vector.
initialValue - Initial value to set all elements to
Returns:
Vector of the given dimensions, with all value equal to initialValue

createVector1D

public Vector1D createVector1D(double x)
Description copied from class: VectorFactory
Creates a one-dimensional vector with the given x coordinate: (x). This is useful mainly for creating a vector wrapper for the double.

Specified by:
createVector1D in class VectorFactory<DenseVector>
Parameters:
x - The x coordinate.
Returns:
A new one-dimensional vector with the given coordinate.

createVector2D

public Vector2 createVector2D(double x,
                              double y)
Description copied from class: VectorFactory
Creates a two-dimensional vector with the given x and y coordinates: (x, y).

Specified by:
createVector2D in class VectorFactory<DenseVector>
Parameters:
x - The x coordinate.
y - The y coordinate.
Returns:
A new two-dimensional vector with the given coordinates.

createVector3D

public Vector3 createVector3D(double x,
                              double y,
                              double z)
Description copied from class: VectorFactory
Creates a three-dimensional vector with the given x, y, and z coordinates: (x, y, z).

Specified by:
createVector3D in class VectorFactory<DenseVector>
Parameters:
x - The x coordinate.
y - The y coordinate.
z - The z coordinate.
Returns:
A new three-dimensional vector with the given coordinates.

createWrapper

public DenseVector createWrapper(no.uib.cipr.matrix.DenseVector internalVector)
Creates a new wrapper for a dense MTJ vector.

Parameters:
internalVector - The MTJ vector to wrap.
Returns:
A wrapper of the given MTJ vector.