Class SparseMatrix

  extended by gov.sandia.cognition.util.AbstractCloneableSerializable
      extended by gov.sandia.cognition.math.AbstractRing<Matrix>
          extended by gov.sandia.cognition.math.matrix.AbstractMatrix
              extended by gov.sandia.cognition.math.matrix.mtj.AbstractMTJMatrix
                  extended by gov.sandia.cognition.math.matrix.mtj.AbstractSparseMatrix
                      extended by gov.sandia.cognition.math.matrix.mtj.SparseRowMatrix
                          extended by gov.sandia.cognition.math.matrix.mtj.SparseMatrix
All Implemented Interfaces:
Matrix, Vectorizable, Ring<Matrix>, CloneableSerializable, Serializable, Cloneable, Iterable<MatrixEntry>

@CodeReview(reviewer="Justin Basilico",
            comments="The readObject and writeObjects need to be implemented or removed if they are no longer needed.",
            response=@CodeReviewResponse(respondent="Kevin R. Dixon",date="2007-04-02",moreChangesNeeded=false,comments="Moved readObject and writeObject up the inheritance tree."))
public class SparseMatrix
extends SparseRowMatrix

A sparse matrix, represented as a collection of sparse row vectors. Generally, this is the fastest sparse matrix for premultiplying against a vector. Adding elements to this matrix is fast. The matrix will not automatically remove zeroed elements. Based on SparseRowMatrix.

Kevin R. Dixon
See Also:
Serialized Form

Constructor Summary
protected SparseMatrix(int numRows, int numColumns)
          Creates a new empty instance of SparseMatrix.
protected SparseMatrix(Matrix matrix)
          Converts the given matrix to a SparseMatrix.
Method Summary
Methods inherited from class gov.sandia.cognition.math.matrix.mtj.SparseRowMatrix
compact, getInternalMatrix, getRow, getSubMatrix, setRow, times, transpose
Methods inherited from class gov.sandia.cognition.math.matrix.mtj.AbstractSparseMatrix
getColumn, isSparse, pseudoInverse, setElement, solve, times, toString, toString
Methods inherited from class gov.sandia.cognition.math.matrix.mtj.AbstractMTJMatrix
clone, convertFromVector, convertToVector, dotTimesEquals, dotTimesEquals, equals, getElement, getNumColumns, getNumRows, getSubMatrixInto, identity, inverse, isSquare, isSymmetric, iterator, logDeterminant, minusEquals, minusEquals, normFrobenius, plusEquals, plusEquals, rank, scaledMinusEquals, scaledPlusEquals, scaledPlusEquals, scaleEquals, setInternalMatrix, solve, solve, solve, times, times, timesInto, timesInto, transposeInto, zero
Methods inherited from class gov.sandia.cognition.math.matrix.AbstractMatrix
assertSameDimensions, checkMultiplicationDimensions, checkSameDimensions, dotDivide, dotDivideEquals, equals, equals, getColumnInto, getRowInto, hashCode, isSymmetric, isZero, pseudoInverse, rank, setColumn, setRow, setSubMatrix, sumOfColumns, sumOfRows, toArray, trace
Methods inherited from class gov.sandia.cognition.math.AbstractRing
dotTimes, isZero, minus, negative, negativeEquals, plus, scale, scaledMinus, scaledMinusEquals, scaledPlus
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface gov.sandia.cognition.math.Ring
dotTimes, isZero, minus, negative, negativeEquals, plus, scale, scaledMinus, scaledMinusEquals, scaledPlus

Constructor Detail


protected SparseMatrix(int numRows,
                       int numColumns)
Creates a new empty instance of SparseMatrix.

numRows - Number of rows in the matrix.
numColumns - Number of columns in the matrix.


protected SparseMatrix(Matrix matrix)
Converts the given matrix to a SparseMatrix.

matrix - Matrix to convert, will not be modified.