sbrt.kernel.math.algebra
Class AbstractMdMatrix<R,C>

java.lang.Object
  extended by sbrt.kernel.math.algebra.AbstractMdMatrix<R,C>
Type Parameters:
R - the row type.
C - the column type.
All Implemented Interfaces:
DoubleMatrix<R,C>, DoubleMatrixBuilder<R,C>, Matrix<R,C,java.lang.Double>, MatrixBuilder<R,C,java.lang.Double>
Direct Known Subclasses:
AbstractSmdMatrix

public abstract class AbstractMdMatrix<R,C>
extends java.lang.Object
implements DoubleMatrixBuilder<R,C>

This abstract class is a skeleton implementation of DoubleMatrixBuilder.

Author:
This class was written and documented by Jeremiah Wright while in the Wagner lab.

Constructor Summary
AbstractMdMatrix()
           
 
Method Summary
 boolean equals(java.lang.Object obj)
          Indicates if the provided object is equal to this matrix.
 int hashCode()
          Returns a content-based hash code.
 boolean isEmpty()
          Indicates if this matrix is empty.
 void setElements(DoubleMatrix<? extends R,? extends C> m)
          Sets the corresponding elements of this matrix to those of the provided matrix.
 java.lang.String toString()
          Returns a string representation of this matrix.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface sbrt.kernel.math.algebra.DoubleMatrixBuilder
setElement
 
Methods inherited from interface sbrt.kernel.math.algebra.MatrixBuilder
removeColumn, removeRow, setElement, setElements
 
Methods inherited from interface sbrt.kernel.math.algebra.DoubleMatrix
getColumn, getElement, getRow, toLinearCombs
 
Methods inherited from interface sbrt.kernel.math.algebra.Matrix
columns, getColumnIndices, getRowIndices, isColumnIndex, isRowIndex, rows
 

Constructor Detail

AbstractMdMatrix

public AbstractMdMatrix()
Method Detail

isEmpty

public boolean isEmpty()
Indicates if this matrix is empty.

Specified by:
isEmpty in interface Matrix<R,C,java.lang.Double>
Returns:
rows() == 0 && columns() == 0.

toString

public java.lang.String toString()
Returns a string representation of this matrix.

Specified by:
toString in interface Matrix<R,C,java.lang.Double>
Overrides:
toString in class java.lang.Object
Returns:
a string representation of this matrix.

equals

public boolean equals(java.lang.Object obj)
Indicates if the provided object is equal to this matrix. Two matrices are considered equal if they share the same sets of column and row indices and the elements in each matrix for each column-row index pair are the same.

Specified by:
equals in interface Matrix<R,C,java.lang.Double>
Overrides:
equals in class java.lang.Object
Parameters:
obj - the object with which to compare.
Returns:
true if this object equals the provided object; false otherwise.

hashCode

public int hashCode()
Returns a content-based hash code.

Specified by:
hashCode in interface Matrix<R,C,java.lang.Double>
Overrides:
hashCode in class java.lang.Object
Returns:
a content-based hash code.

setElements

public void setElements(DoubleMatrix<? extends R,? extends C> m)
Sets the corresponding elements of this matrix to those of the provided matrix.

Specified by:
setElements in interface DoubleMatrixBuilder<R,C>
Parameters:
m - the matrix whose elements are to be copied into this matrix.