@CodeReview(reviewer="Justin Basilico", date="2006-07-27", changesNeeded=false, comments="Looks good.") public class SparseColumnMatrix extends AbstractSparseMatrix
Modifier | Constructor and Description |
---|---|
protected |
SparseColumnMatrix(no.uib.cipr.matrix.sparse.FlexCompColMatrix internalMatrix)
Creates a SparseColumnMatrix based on the appropriate MTJ matrix,
does NOT create a copy of internalMatrix.
|
protected |
SparseColumnMatrix(int numRows,
int numColumns)
Creates a new empty instance of SparseColumnMatrix.
|
protected |
SparseColumnMatrix(Matrix matrix)
Copy constructor for general matrices, copies over nonzero values.
|
protected |
SparseColumnMatrix(SparseColumnMatrix matrix)
Copy constructor for SparseColumnMatrix matrices.
|
Modifier and Type | Method and Description |
---|---|
void |
compact()
Compact the memory used by the matrix, getting rid of any zero elements
|
SparseVector |
getColumn(int columnIndex)
Gets the specified column of the matrix, using MTJ's internal routine
to speed things up
|
int |
getEntryCount()
Gets the number of active entries in the matrix.
|
no.uib.cipr.matrix.sparse.FlexCompColMatrix |
getInternalMatrix()
Gets the internal MTJ matrix that this class is wrapping.
|
MatrixFactory<?> |
getMatrixFactory()
Gets a matrix factory, typically one associated with this type of matrix.
|
SparseColumnMatrix |
getSubMatrix(int minRow,
int maxRow,
int minColumn,
int maxColumn)
Gets the embedded submatrix inside of the Matrix, specified by the
inclusive, zero-based indices such that the result matrix will have size
(maxRow-minRow+1) x (maxColum-minCcolumn+1)
|
void |
setColumn(int columnIndex,
SparseVector columnVector)
Sets the column of the matrix using the given SparseVector, using MTJ's
internal routine to speed things up
|
SparseColumnMatrix |
times(AbstractMTJMatrix matrix)
Matrix multiplication of
this and matrix ,
operates like the "* " operator in Matlab |
SparseRowMatrix |
transpose()
Returns the transpose of
this |
getRow, isSparse, pseudoInverse, setElement, solve, times, toString, toString
clone, convertFromVector, convertToVector, dotTimesEquals, dotTimesEquals, equals, get, getElement, getNumColumns, getNumRows, getSubMatrixInto, identity, increment, inverse, isSquare, isSymmetric, iterator, logDeterminant, minusEquals, minusEquals, normFrobenius, normFrobeniusSquared, plusEquals, plusEquals, rank, scaledMinusEquals, scaledPlusEquals, scaledPlusEquals, scaleEquals, set, setInternalMatrix, solve, solve, solve, times, times, timesInto, timesInto, transposeInto, zero
assertMultiplicationDimensions, assertSameDimensions, checkMultiplicationDimensions, checkSameDimensions, decrement, decrement, dotDivide, dotDivideEquals, equals, equals, getColumnInto, getRowInto, hashCode, increment, isSymmetric, isZero, pseudoInverse, rank, setColumn, setRow, setSubMatrix, sumOfColumns, sumOfRows, toArray, trace, valuesAsList
dotTimes, isZero, minus, negative, negativeEquals, plus, scale, scaledMinus, scaledMinusEquals, scaledPlus
finalize, getClass, notify, notifyAll, wait, wait, wait
dotTimes, isZero, minus, negative, negativeEquals, plus, scale, scaledMinus, scaledMinusEquals, scaledPlus
protected SparseColumnMatrix(int numRows, int numColumns)
numRows
- Number of rows in the matrix.numColumns
- Number of columns in the matrix.protected SparseColumnMatrix(SparseColumnMatrix matrix)
matrix
- Matrix from which to copy the internal MTJ matrix.protected SparseColumnMatrix(Matrix matrix)
matrix
- Matrix from which to copy the nonzero elements into this.protected SparseColumnMatrix(no.uib.cipr.matrix.sparse.FlexCompColMatrix internalMatrix)
internalMatrix
- New internal matrix for this, no copy made.public no.uib.cipr.matrix.sparse.FlexCompColMatrix getInternalMatrix()
AbstractMTJMatrix
getInternalMatrix
in class AbstractMTJMatrix
public SparseColumnMatrix times(AbstractMTJMatrix matrix)
AbstractMTJMatrix
this
and matrix
,
operates like the "*
" operator in Matlabtimes
in class AbstractMTJMatrix
matrix
- this.getNumColumns()==matrix.getNumRows()
this
and
matrix
, will this.getNumRows()
rows and
matrix.getNumColumns()
columnspublic SparseColumnMatrix getSubMatrix(int minRow, int maxRow, int minColumn, int maxColumn)
Matrix
minRow
- Zero-based index into the rows of the Matrix, must be less
than or equal to maxRowmaxRow
- Zero-based index into the rows of the Matrix, must be
greater than or equal to minRowminColumn
- Zero-based index into the rows of the Matrix, must be
less than or equal to maxColumnmaxColumn
- Zero-based index into the rows of the Matrix, must be
greater than or equal to minColumnpublic SparseVector getColumn(int columnIndex)
getColumn
in interface Matrix
getColumn
in class AbstractSparseMatrix
columnIndex
- zero-based column indexpublic void setColumn(int columnIndex, SparseVector columnVector)
columnIndex
- Zero-based column index.columnVector
- SparseVector containing the elements to replace in
this.public SparseRowMatrix transpose()
Matrix
this
this.getElement(i, j) == this.transpose().getElement(j, i)
for any valid i, j
.public void compact()
AbstractSparseMatrix
compact
in class AbstractSparseMatrix
public int getEntryCount()
Matrix
public MatrixFactory<?> getMatrixFactory()
Matrix