sbrt.kernel.math.algebra
Class MatrixElement<R,C,E>

java.lang.Object
  extended by sbrt.kernel.math.algebra.MatrixElement<R,C,E>
Type Parameters:
R - the row index type.
C - the column index type.
E - the matrix element type.

public final class MatrixElement<R,C,E>
extends java.lang.Object

This class is used to represent matrix elements.

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

Constructor Summary
MatrixElement(IndexPair<R,C> indices, U element)
          Constructs a new matrix element.
MatrixElement(S rowIndex, T columnIndex, U element)
          Constructs a new matrix element.
 
Method Summary
 boolean equals(java.lang.Object obj)
          Indicates if this matrix element is equal to the provided object.
 C getColumnIndex()
          Returns the column index of this matrix element.
 E getElement()
          Returns the value of this matrix element.
 IndexPair<R,C> getIndices()
          Returns the pair of indices.
 R getRowIndex()
          Returns the row index of this matrix element.
 int hashCode()
          Returns a content-based hash code.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MatrixElement

public MatrixElement(S rowIndex,
                     T columnIndex,
                     U element)
Constructs a new matrix element.

Type Parameters:
S - a type extending the primary row type.
T - a type extending the primary column type.
U - a type extending the primary element type.
Parameters:
rowIndex - the row index.
columnIndex - the column index.
element - the matrix element at the specified row and column indices.

MatrixElement

public MatrixElement(IndexPair<R,C> indices,
                     U element)
Constructs a new matrix element.

Type Parameters:
U - a type extending the primary element type.
Parameters:
indices - the row and column index of this element.
element - the matrix element at the specified row and column indices.
Method Detail

getRowIndex

public R getRowIndex()
Returns the row index of this matrix element.

Returns:
the row index of this matrix element.

getColumnIndex

public C getColumnIndex()
Returns the column index of this matrix element.

Returns:
the column index of this matrix element.

getIndices

public IndexPair<R,C> getIndices()
Returns the pair of indices.

Returns:
the pair of indices.

getElement

public E getElement()
Returns the value of this matrix element.

Returns:
the value of this matrix element.

equals

public boolean equals(java.lang.Object obj)
Indicates if this matrix element is equal to the provided object. Two matrix elements are equal if their row index, column index, and element are equal, respectively.

Overrides:
equals in class java.lang.Object
Parameters:
obj - the reference object with which to compare.
Returns:
true if this matrix element equals the provided object; false otherwise.

hashCode

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

Overrides:
hashCode in class java.lang.Object
Returns:
a content-based hash code.