net.sourceforge.combean.mathprog.linalg
Class IdentityMatrix

Package class diagram package IdentityMatrix
java.lang.Object
  extended by net.sourceforge.combean.mathprog.linalg.IdentityMatrix
All Implemented Interfaces:
AbstractMatrix, ColumnMatrix, Matrix, RowMatrix

public class IdentityMatrix
extends Object
implements Matrix

The identity matrix for a given dimension.


Constructor Summary
IdentityMatrix(int dimension)
          Constructor.
 
Method Summary
 SparseVector getColumnVector(int localColumn)
          Return a column vector of the matrix.
 double getDoubleAt(int row, int column)
           
 int getNumColumns()
          Return the number of columns of the model component.
 int getNumRows()
          Return the number of rows of the model component.
 SparseVector getRowVector(int localRow)
          Return a row vector of the matrix.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

IdentityMatrix

public IdentityMatrix(int dimension)
Constructor.

Parameters:
dimension - the dimension (number of rows = number of columns) of the matrix.
Method Detail

getDoubleAt

public double getDoubleAt(int row,
                          int column)
Specified by:
getDoubleAt in interface Matrix

getColumnVector

public SparseVector getColumnVector(int localColumn)
Description copied from interface: ColumnMatrix
Return a column vector of the matrix.

Specified by:
getColumnVector in interface ColumnMatrix
Parameters:
localColumn - the index of the column
Returns:
the corresponding column vector

getRowVector

public SparseVector getRowVector(int localRow)
Description copied from interface: RowMatrix
Return a row vector of the matrix.

Specified by:
getRowVector in interface RowMatrix
Parameters:
localRow - the index of the row
Returns:
the corresponding row vector

getNumColumns

public int getNumColumns()
Description copied from interface: AbstractMatrix
Return the number of columns of the model component.

Specified by:
getNumColumns in interface AbstractMatrix
Returns:
the number of columns.

getNumRows

public int getNumRows()
Description copied from interface: AbstractMatrix
Return the number of rows of the model component.

Specified by:
getNumRows in interface AbstractMatrix
Returns:
the number of rows.