edu.iu.iv.common.datamodels.matrixmodel
Class DenseDoubleMatrixModel

java.lang.Object
  |
  +--cern.colt.PersistentObject
        |
        +--cern.colt.matrix.impl.AbstractMatrix
              |
              +--cern.colt.matrix.impl.AbstractMatrix2D
                    |
                    +--cern.colt.matrix.DoubleMatrix2D
                          |
                          +--cern.colt.matrix.impl.DenseDoubleMatrix2D
                                |
                                +--edu.iu.iv.common.datamodels.matrixmodel.DenseDoubleMatrixModel
All Implemented Interfaces:
java.lang.Cloneable, DoubleMatrixModel, java.io.Serializable

public class DenseDoubleMatrixModel
extends cern.colt.matrix.impl.DenseDoubleMatrix2D
implements DoubleMatrixModel

An adapter class that implements the DoubleMatrixModel interface and extends the Cern Colt API's fast hashed implementation of a dense 2D matrix. Users new to to using matrices are urged to use the methods defined by the interface rather than using the inherited methods directly since this model is optimized for speed at the cost of error checking. Some methods such as getQuick and setQuick do not do any bounds checking and hence the result of such function calls is undefined in case of error. We recommend you to read the documentation for the CERN Colt API.

Version:
0.1
Author:
TeamIVC
See Also:
DenseDoubleMatrix2D, Serialized Form

Field Summary
 
Fields inherited from class cern.colt.PersistentObject
serialVersionUID
 
Constructor Summary
DenseDoubleMatrixModel(double[][] values)
          Creates a matrix and fills them with the elements of the array passed in.
DenseDoubleMatrixModel(int numRows, int numCols)
          Creates a matrix with numRows rows and numCols columns and fills them with zero values.
 
Method Summary
 java.lang.String getColumnLabel(int column)
          Gets the label for the specified column.
 int getNumberOfColumns()
           
 int getNumberOfRows()
           
 java.lang.String getRowLabel(int row)
          Gets the label for the specified row.
 void setColumnLabel(int column, java.lang.String text)
          Sets the label at the specified column to the specified text.
 void setRowLabel(int row, java.lang.String text)
          Sets the label of the specified row to the specified text.
 
Methods inherited from class cern.colt.matrix.impl.DenseDoubleMatrix2D
assign, assign, assign, assign, assign, getQuick, like, like1D, setQuick, zAssign8Neighbors, zMult, zMult, zSum
 
Methods inherited from class cern.colt.matrix.DoubleMatrix2D
aggregate, aggregate, cardinality, copy, equals, equals, forEachNonZero, get, getNonZeros, like, set, toArray, toString, viewColumn, viewColumnFlip, viewDice, viewPart, viewRow, viewRowFlip, viewSelection, viewSelection, viewSorted, viewStrides, zMult, zMult
 
Methods inherited from class cern.colt.matrix.impl.AbstractMatrix2D
checkShape, checkShape, columns, rows, size, toStringShort
 
Methods inherited from class cern.colt.matrix.impl.AbstractMatrix
ensureCapacity, trimToSize
 
Methods inherited from class cern.colt.PersistentObject
clone
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface edu.iu.iv.core.datamodels.matrixmodel.DoubleMatrixModel
get, set
 

Constructor Detail

DenseDoubleMatrixModel

public DenseDoubleMatrixModel(int numRows,
                              int numCols)
Creates a matrix with numRows rows and numCols columns and fills them with zero values. Also allocates memory for row and column labels.

Parameters:
numRows - The number of rows for this matrix.
numCols - The number of columns for this matrix.

DenseDoubleMatrixModel

public DenseDoubleMatrixModel(double[][] values)
Creates a matrix and fills them with the elements of the array passed in. Also allocates memory for row and column labels.

Parameters:
values - The array containing matrix elements.
Method Detail

setColumnLabel

public void setColumnLabel(int column,
                           java.lang.String text)
Description copied from interface: DoubleMatrixModel
Sets the label at the specified column to the specified text.

Specified by:
setColumnLabel in interface DoubleMatrixModel
Parameters:
column - The column number.
text - The text of the label.
See Also:
DoubleMatrixModel.setColumnLabel(int, java.lang.String)

getColumnLabel

public java.lang.String getColumnLabel(int column)
Description copied from interface: DoubleMatrixModel
Gets the label for the specified column.

Specified by:
getColumnLabel in interface DoubleMatrixModel
Parameters:
column - The column number.
Returns:
The text of the label.
See Also:
DoubleMatrixModel.getColumnLabel(int)

setRowLabel

public void setRowLabel(int row,
                        java.lang.String text)
Description copied from interface: DoubleMatrixModel
Sets the label of the specified row to the specified text.

Specified by:
setRowLabel in interface DoubleMatrixModel
Parameters:
row - The row number.
text - The text of the label.
See Also:
DoubleMatrixModel.setRowLabel(int, java.lang.String)

getRowLabel

public java.lang.String getRowLabel(int row)
Description copied from interface: DoubleMatrixModel
Gets the label for the specified row.

Specified by:
getRowLabel in interface DoubleMatrixModel
Parameters:
row - The row number.
Returns:
The text of the label.
See Also:
DoubleMatrixModel.getRowLabel(int)

getNumberOfRows

public int getNumberOfRows()
Specified by:
getNumberOfRows in interface DoubleMatrixModel
Returns:
The number of rows of the matrix.

getNumberOfColumns

public int getNumberOfColumns()
Specified by:
getNumberOfColumns in interface DoubleMatrixModel
Returns:
The number of columns of the matrix.