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

java.lang.Object
  extended by gov.sandia.cognition.math.matrix.MatrixFactory<DiagonalMatrixMTJ>
      extended by gov.sandia.cognition.math.matrix.mtj.DiagonalMatrixFactoryMTJ
All Implemented Interfaces:
Serializable

public class DiagonalMatrixFactoryMTJ
extends MatrixFactory<DiagonalMatrixMTJ>

An MatrixFactory that produces DiagonalMatrixMTJ matrices.

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

Field Summary
static DiagonalMatrixFactoryMTJ INSTANCE
          Default instance of the class
 
Fields inherited from class gov.sandia.cognition.math.matrix.MatrixFactory
DEFAULT_DENSE_INSTANCE, DEFAULT_DIAGONAL_INSTANCE, DEFAULT_SPARSE_INSTANCE
 
Constructor Summary
DiagonalMatrixFactoryMTJ()
          Creates a new instance of DiagonalMatrixFactoryMTJ
 
Method Summary
 DiagonalMatrixMTJ copyMatrix(Matrix m)
          Creates a deep copy new Matrix given another, argument is unchanged
 DiagonalMatrixMTJ createMatrix(int dim)
          Creates a square diagonal matrix of dimensionality "dim" with zeros along the diagonal
 DiagonalMatrixMTJ createMatrix(int numRows, int numColumns)
          Creates an empty Matrix of the specified dimensions, all elements must be all zeros!
 DiagonalMatrixMTJ createMatrix(int numRows, int numColumns, double initialValue)
          Creates a matrix with the given initial value on all of the elements of the diagonal.
 DiagonalMatrixMTJ createUniformRandom(int dimensionality, double min, double max, Random random)
          Creates a new square Matrix of the given size with random values for the entries, uniformly distributed between the given minimum and maximum values.
 DiagonalMatrixMTJ createUniformRandom(int numRows, int numColumns, double min, double max, Random random)
          Creates a new Matrix of the given size with random values for the entries, uniformly distributed between the given minimum and maximum values.
 DiagonalMatrixMTJ diagonalValues(double[] diagonal)
          Creates a diagonal matrix with the array of values on its diagonal
 
Methods inherited from class gov.sandia.cognition.math.matrix.MatrixFactory
copyArray, copyColumnVectors, copyColumnVectors, copyRowVectors, copyRowVectors, createDiagonal, createIdentity, getDefault, getDenseDefault, getDiagonalDefault, 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 DiagonalMatrixFactoryMTJ INSTANCE
Default instance of the class

Constructor Detail

DiagonalMatrixFactoryMTJ

public DiagonalMatrixFactoryMTJ()
Creates a new instance of DiagonalMatrixFactoryMTJ

Method Detail

copyMatrix

public DiagonalMatrixMTJ copyMatrix(Matrix m)
Description copied from class: MatrixFactory
Creates a deep copy new Matrix given another, argument is unchanged

Specified by:
copyMatrix in class MatrixFactory<DiagonalMatrixMTJ>
Parameters:
m - Matrix to copy
Returns:
Deep copy of the given Matrix

createMatrix

public DiagonalMatrixMTJ createMatrix(int numRows,
                                      int numColumns)
Description copied from class: MatrixFactory
Creates an empty Matrix of the specified dimensions, all elements must be all zeros!

Specified by:
createMatrix in class MatrixFactory<DiagonalMatrixMTJ>
Parameters:
numRows - number of rows in the Matrix
numColumns - number of columns in the Matrix
Returns:
All-zero empty Matrix of the specified dimensions

createMatrix

public DiagonalMatrixMTJ createMatrix(int dim)
Creates a square diagonal matrix of dimensionality "dim" with zeros along the diagonal

Parameters:
dim - Number of dimensions of the square matrix
Returns:
Square diagonal matrix with zeros along the diagonal

diagonalValues

public DiagonalMatrixMTJ diagonalValues(double[] diagonal)
Creates a diagonal matrix with the array of values on its diagonal

Parameters:
diagonal - Values for the diagonal entries of the matrix
Returns:
Diagonal matrix with the specified diagonal entries

createMatrix

public DiagonalMatrixMTJ createMatrix(int numRows,
                                      int numColumns,
                                      double initialValue)
Creates a matrix with the given initial value on all of the elements of the diagonal.

Overrides:
createMatrix in class MatrixFactory<DiagonalMatrixMTJ>
Parameters:
numRows - The number of rows. Cannot be negative.
numColumns - The number of columns. Cannot be negative.
initialValue - The initial value to set all elements to.
Returns:
A Matrix of the given size initialized with the given initial value.

createUniformRandom

public DiagonalMatrixMTJ createUniformRandom(int numRows,
                                             int numColumns,
                                             double min,
                                             double max,
                                             Random random)
Description copied from class: MatrixFactory
Creates a new Matrix of the given size with random values for the entries, uniformly distributed between the given minimum and maximum values.

Overrides:
createUniformRandom in class MatrixFactory<DiagonalMatrixMTJ>
Parameters:
numRows - The number of rows in the Matrix.
numColumns - The number of columns in the Matrix.
min - The minimum range of the uniform distribution.
max - The maximum range of the uniform distribution.
random - The random number generator.
Returns:
Matrix with random values for the entries, uniformly distributed between the given minimum and maximum values.

createUniformRandom

public DiagonalMatrixMTJ createUniformRandom(int dimensionality,
                                             double min,
                                             double max,
                                             Random random)
Creates a new square Matrix of the given size with random values for the entries, uniformly distributed between the given minimum and maximum values.

Parameters:
dimensionality - The number of rows and columns for this square matrix.
min - The minimum range of the uniform distribution.
max - The maximum range of the uniform distribution.
random - The random number generator.
Returns:
Matrix with random values for the entries, uniformly distributed between the given minimum and maximum values.