Class NativeHDF5MatrixStorage
java.lang.Object
org.episteme.nativ.mathematics.linearalgebra.matrices.storage.NativeHDF5MatrixStorage
- All Implemented Interfaces:
AutoCloseable, MatrixStorage<Real>
Matrix storage backed by HDF5 with hyperslab support for partial loading.
This storage allows working with matrices larger than available RAM by loading only the required tiles from disk on-demand.
- Since:
- 1.1
- Author:
- Silvere Martin-Michiellot, Gemini AI (Google DeepMind)
-
Constructor Summary
ConstructorsConstructorDescriptionNativeHDF5MatrixStorage(Path hdf5Path, String datasetName) Creates HDF5-backed matrix storage. -
Method Summary
Modifier and TypeMethodDescriptionclone()Creates a deep copy of this storage.voidclose()intcols()Returns the number of columns.get(int row, int col) Returns the element at the specified position.loadBlock(int startRow, int startCol, int rowCount, int colCount) Loads a rectangular block from the HDF5 file.introws()Returns the number of rows.voidSets the element at the specified position.
-
Constructor Details
-
NativeHDF5MatrixStorage
-
-
Method Details
-
rows
public int rows()Description copied from interface:MatrixStorageReturns the number of rows.- Specified by:
rowsin interfaceMatrixStorage<Real>- Returns:
- the row count
-
cols
public int cols()Description copied from interface:MatrixStorageReturns the number of columns.- Specified by:
colsin interfaceMatrixStorage<Real>- Returns:
- the column count
-
get
Description copied from interface:MatrixStorageReturns the element at the specified position.- Specified by:
getin interfaceMatrixStorage<Real>- Parameters:
row- the row indexcol- the column index- Returns:
- the element at [row, col]
-
set
Description copied from interface:MatrixStorageSets the element at the specified position.- Specified by:
setin interfaceMatrixStorage<Real>- Parameters:
row- the row indexcol- the column indexvalue- the value to set
-
loadBlock
Loads a rectangular block from the HDF5 file.- Parameters:
startRow- Starting row (0-indexed)startCol- Starting column (0-indexed)rowCount- Number of rows to loadcolCount- Number of columns to load- Returns:
- Matrix containing the loaded block
-
close
public void close()- Specified by:
closein interfaceAutoCloseable
-
clone
Description copied from interface:MatrixStorageCreates a deep copy of this storage.- Specified by:
clonein interfaceMatrixStorage<Real>- Overrides:
clonein classObject- Returns:
- a clone of this storage
-