idl.tmt.representation.matrix
Class DenseMatrixReader

java.lang.Object
  |
  +--idl.tmt.representation.matrix.DenseMatrixReader

public class DenseMatrixReader
extends java.lang.Object

Class for reading dense matrices from disk.

Author:
miles

Field Summary
(package private)  int i
           
(package private)  int j
           
(package private)  DoubleMatrix2D matrix
           
 
Constructor Summary
DenseMatrixReader()
           
 
Method Summary
 DoubleMatrix2D readMatrix(java.lang.String theFile)
          read a dense matrix into memory from disk.
 DoubleMatrix2D readMatrix(java.lang.String theFile, int rows, int cols)
          Load a matrix from a file
 
Methods inherited from class java.lang.Object
, clone, equals, finalize, getClass, hashCode, notify, notifyAll, registerNatives, toString, wait, wait, wait
 

Field Detail

matrix

DoubleMatrix2D matrix

i

int i

j

int j
Constructor Detail

DenseMatrixReader

public DenseMatrixReader()
Method Detail

readMatrix

public DoubleMatrix2D readMatrix(java.lang.String theFile,
                                 int rows,
                                 int cols)
Load a matrix from a file
Parameters:
theFile - the name of a file on disk with row-oriented matrix
rows - number of rows
cols - number of columns
Returns:
a DoubleMatrix2D mirroring the contents of the file

readMatrix

public DoubleMatrix2D readMatrix(java.lang.String theFile)
read a dense matrix into memory from disk. this method doesn't require us to specify the number of rows and columns...but we have to read through the file twice
Parameters:
theFile -  
Returns:
a dense matrix