public class MatrixColumnMajor extends Matrix
INT_ENTRIES, LONG_ENTRIES| Constructor and Description |
|---|
MatrixColumnMajor(String filename) |
MatrixColumnMajor(String filename,
int numberOfRows,
int numberOfColumns,
boolean rowFormat,
int entriesType) |
| Modifier and Type | Method and Description |
|---|---|
static void |
main(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(String filename, int numberOfRows, int numberOfColumns, boolean rowFormat, int entriesType) throws IOException
IOExceptionpublic MatrixColumnMajor(String filename) throws IOException
IOExceptionpublic int[][] readIntMatrix()
throws IOException
MatrixOutOfMemoryErrorreadIntMatrix in class MatrixIOException - If there are problems reading from the file.public int[] readIntMatrixColumn(int columnId)
throws IOException
MatrixreadIntMatrixColumn in class MatrixcolumnId - The matrix column that needs to be retrievedIOException - If there are problems locating the file or reading its
contents.public int readIntMatrixElement(int rowId,
int columnId)
throws IOException
Matrix[rowId, columId].readIntMatrixElement in class MatrixrowId - The rowId for the matrix elementcolumnId - The columnId for the matrix elementmatrix[rowId, columnId] element.IOException - If there are problems reading the file.public int[] readIntMatrixRow(int rowId)
throws IOException
MatrixreadIntMatrixRow in class MatrixrowId - The matrix row that needs to be retrievedIOException - If there are problems locating the file or reading its
contents.public long[][] readLongMatrix()
throws IOException
MatrixOutOfMemoryErrorreadLongMatrix in class MatrixIOException - If there are problems reading from the file.public long[] readLongMatrixColumn(int columnId)
throws IOException
MatrixreadLongMatrixColumn in class MatrixcolumnId - The matrix column that needs to be retrievedIOException - If there are problems locating the file or reading its
contents.public long readLongMatrixElement(int rowId,
int columnId)
throws IOException
Matrix[rowId, columId].readLongMatrixElement in class MatrixrowId - The rowId for the matrix elementcolumnId - The columnId for the matrix elementmatrix[rowId, columnId] element.IOException - If there are problems reading the file.public long[] readLongMatrixRow(int rowId)
throws IOException
MatrixreadLongMatrixRow in class MatrixrowId - The matrix row that needs to be retrievedIOException - If there are problems locating the file or reading its
contents.public void writeIntMatrixColumn(int columnId,
int[] columnValues)
throws IOException
MatrixwriteIntMatrixColumn in class MatrixcolumnId - The columnId for the matrix columncolumnValues - Values associated with the columnIOException - If there are problems writing to the file.public void writeIntMatrixElement(int rowId,
int columnId,
int value)
throws 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]IOException - If there are problems writing to the file.public void writeIntMatrixRow(int rowId,
int[] rowValues)
throws IOException
MatrixwriteIntMatrixRow in class MatrixrowId - The identifier of the matrix rowrowValues - The values associated with the rowIOException - If there are problems writing to the file.public void writeLongMatrixColumn(int columnId,
long[] columnValues)
throws IOException
MatrixwriteLongMatrixColumn in class MatrixcolumnId - The columnId for the matrix columncolumnValues - Values associated with the columnIOException - If there are problems writing to the file.public void writeLongMatrixElement(int rowId,
int columnId,
long value)
throws 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]IOException - If there are problems writing to the file.public void writeLongMatrixRow(int rowId,
long[] rowValues)
throws IOException
MatrixwriteLongMatrixRow in class MatrixrowId - The identifier of the matrix rowrowValues - The values associated with the rowIOException - If there are problems writing to the file.public static void main(String[] args)
args - Copyright © 2015. All rights reserved.