public class MatrixColumnMajor extends Matrix
INT_ENTRIES, LONG_ENTRIES| Constructor and Description |
|---|
MatrixColumnMajor(java.lang.String filename) |
MatrixColumnMajor(java.lang.String filename,
int numberOfRows,
int numberOfColumns,
boolean rowFormat,
int entriesType) |
| Modifier and Type | Method and Description |
|---|---|
static void |
main(java.lang.String[] args) |
int[][] |
readIntMatrix()
Read a matrix that has been written to a file (specified in the
constructor) based on the specified rows and columns.
|
int[] |
readIntMatrixColumn(int columnId)
This method reads a specified column from the matrix that has been
written to a file.
|
int |
readIntMatrixElement(int rowId,
int columnId)
Reads a matrix element from the underlying file based on the specified
[rowId, columId]. |
int[] |
readIntMatrixRow(int rowId)
This method reads the specified row of a matrix that has been written to
a file.
|
long[][] |
readLongMatrix()
Read a matrix that has been written to a file (specified in the
constructor) based on the specified rows and columns.
|
long[] |
readLongMatrixColumn(int columnId)
This method reads a specified column from the matrix that has been
written to a file.
|
long |
readLongMatrixElement(int rowId,
int columnId)
Reads a matrix element from the underlying file based on the specified
[rowId, columId]. |
long[] |
readLongMatrixRow(int rowId)
This method reads the specified row of a matrix that has been written to
a file.
|
void |
writeIntMatrixColumn(int columnId,
int[] columnValues)
Write a column of the matrix to the underlying file.
|
void |
writeIntMatrixElement(int rowId,
int columnId,
int value)
Write a specific matrix element code>[rowId, columnId] to the
file.
|
void |
writeIntMatrixRow(int rowId,
int[] rowValues)
Write a row of the matrix to the underlying file.
|
void |
writeLongMatrixColumn(int columnId,
long[] columnValues)
Write a column of the matrix to the underlying file.
|
void |
writeLongMatrixElement(int rowId,
int columnId,
long value)
Write a specific matrix element code>[rowId, columnId] to the
file.
|
void |
writeLongMatrixRow(int rowId,
long[] rowValues)
Write a row of the matrix to the underlying file.
|
createDenseIntColumn, createDenseIntRow, getEntriesType, getMetadataLength, getNumberOfColumns, getNumberOfRows, isColumnMajorFormat, isRowMajorFormat, sizepublic MatrixColumnMajor(java.lang.String filename,
int numberOfRows,
int numberOfColumns,
boolean rowFormat,
int entriesType)
throws java.io.IOException
java.io.IOExceptionpublic MatrixColumnMajor(java.lang.String filename)
throws java.io.IOException
java.io.IOExceptionpublic int[][] readIntMatrix()
throws java.io.IOException
MatrixOutOfMemoryErrorreadIntMatrix in class Matrixjava.io.IOException - If there are problems reading from the file.public int[] readIntMatrixColumn(int columnId)
throws java.io.IOException
MatrixreadIntMatrixColumn in class MatrixcolumnId - The matrix column that needs to be retrievedjava.io.IOException - If there are problems locating the file or reading its
contents.public int readIntMatrixElement(int rowId,
int columnId)
throws java.io.IOException
Matrix[rowId, columId].readIntMatrixElement in class MatrixrowId - The rowId for the matrix elementcolumnId - The columnId for the matrix elementmatrix[rowId, columnId] element.java.io.IOException - If there are problems reading the file.public int[] readIntMatrixRow(int rowId)
throws java.io.IOException
MatrixreadIntMatrixRow in class MatrixrowId - The matrix row that needs to be retrievedjava.io.IOException - If there are problems locating the file or reading its
contents.public long[][] readLongMatrix()
throws java.io.IOException
MatrixOutOfMemoryErrorreadLongMatrix in class Matrixjava.io.IOException - If there are problems reading from the file.public long[] readLongMatrixColumn(int columnId)
throws java.io.IOException
MatrixreadLongMatrixColumn in class MatrixcolumnId - The matrix column that needs to be retrievedjava.io.IOException - If there are problems locating the file or reading its
contents.public long readLongMatrixElement(int rowId,
int columnId)
throws java.io.IOException
Matrix[rowId, columId].readLongMatrixElement in class MatrixrowId - The rowId for the matrix elementcolumnId - The columnId for the matrix elementmatrix[rowId, columnId] element.java.io.IOException - If there are problems reading the file.public long[] readLongMatrixRow(int rowId)
throws java.io.IOException
MatrixreadLongMatrixRow in class MatrixrowId - The matrix row that needs to be retrievedjava.io.IOException - If there are problems locating the file or reading its
contents.public void writeIntMatrixColumn(int columnId,
int[] columnValues)
throws java.io.IOException
MatrixwriteIntMatrixColumn in class MatrixcolumnId - The columnId for the matrix columncolumnValues - Values associated with the columnjava.io.IOException - If there are problems writing to the file.public void writeIntMatrixElement(int rowId,
int columnId,
int value)
throws java.io.IOException
MatrixwriteIntMatrixElement in class MatrixrowId - The row identifier for the elementcolumnId - The column identifier for the elementvalue - The value of the matrix element [rowId, columnId]java.io.IOException - If there are problems writing to the file.public void writeIntMatrixRow(int rowId,
int[] rowValues)
throws java.io.IOException
MatrixwriteIntMatrixRow in class MatrixrowId - The identifier of the matrix rowrowValues - The values associated with the rowjava.io.IOException - If there are problems writing to the file.public void writeLongMatrixColumn(int columnId,
long[] columnValues)
throws java.io.IOException
MatrixwriteLongMatrixColumn in class MatrixcolumnId - The columnId for the matrix columncolumnValues - Values associated with the columnjava.io.IOException - If there are problems writing to the file.public void writeLongMatrixElement(int rowId,
int columnId,
long value)
throws java.io.IOException
MatrixwriteLongMatrixElement in class MatrixrowId - The row identifier for the elementcolumnId - The column identifier for the elementvalue - The value of the matrix element [rowId, columnId]java.io.IOException - If there are problems writing to the file.public void writeLongMatrixRow(int rowId,
long[] rowValues)
throws java.io.IOException
MatrixwriteLongMatrixRow in class MatrixrowId - The identifier of the matrix rowrowValues - The values associated with the rowjava.io.IOException - If there are problems writing to the file.public static void main(java.lang.String[] args)
args -