net.sourceforge.combean.mathprog.linalg
Class DoubleMatrix

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

public class DoubleMatrix
extends Object
implements Matrix

A matrix consisting of doubles which is stored in one linear array.


Constructor Summary
DoubleMatrix(double[][] matrix)
           
DoubleMatrix(int numRows, int numColumns)
          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.
 void setDoubleAt(int row, int column, double value)
           
 void setTwoDimDoubleArray(double[][] twoDimArray)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

DoubleMatrix

public DoubleMatrix(int numRows,
                    int numColumns)
Constructor. Fills the matrix with zeroes.

Parameters:
numRows - the number of rows of the matrix.
numColumns - the number of columns of the matrix

DoubleMatrix

public DoubleMatrix(double[][] 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.

setDoubleAt

public void setDoubleAt(int row,
                        int column,
                        double value)

setTwoDimDoubleArray

public void setTwoDimDoubleArray(double[][] twoDimArray)

toString

public String toString()
Overrides:
toString in class Object