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, size
public MatrixColumnMajor(String filename, int numberOfRows, int numberOfColumns, boolean rowFormat, int entriesType) throws IOException
IOException
public MatrixColumnMajor(String filename) throws IOException
IOException
public int[][] readIntMatrix() throws IOException
Matrix
OutOfMemoryError
readIntMatrix
in class Matrix
IOException
- If there are problems reading from the file.public int[] readIntMatrixColumn(int columnId) throws IOException
Matrix
readIntMatrixColumn
in class Matrix
columnId
- 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 Matrix
rowId
- 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
Matrix
readIntMatrixRow
in class Matrix
rowId
- The matrix row that needs to be retrievedIOException
- If there are problems locating the file or reading its
contents.public long[][] readLongMatrix() throws IOException
Matrix
OutOfMemoryError
readLongMatrix
in class Matrix
IOException
- If there are problems reading from the file.public long[] readLongMatrixColumn(int columnId) throws IOException
Matrix
readLongMatrixColumn
in class Matrix
columnId
- 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 Matrix
rowId
- 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
Matrix
readLongMatrixRow
in class Matrix
rowId
- 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
Matrix
writeIntMatrixColumn
in class Matrix
columnId
- 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
Matrix
writeIntMatrixElement
in class Matrix
rowId
- 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
Matrix
writeIntMatrixRow
in class Matrix
rowId
- 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
Matrix
writeLongMatrixColumn
in class Matrix
columnId
- 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
Matrix
writeLongMatrixElement
in class Matrix
rowId
- 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
Matrix
writeLongMatrixRow
in class Matrix
rowId
- 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.