public class OnDiskUpperTriangleMatrix
extends java.lang.Object
implements java.lang.AutoCloseable
| Modifier and Type | Field and Description |
|---|---|
private OnDiskArray |
array
Data storage
|
private int |
matrixsize
Size of the matrix
|
private static long |
serialVersionUID
Serial number, also used for generating a magic
|
private static int |
TRIANGLE_HEADER_SIZE
Size of this class' header
|
| Constructor and Description |
|---|
OnDiskUpperTriangleMatrix(java.io.File filename,
int magicseed,
int extraheadersize,
int recordsize,
boolean writable)
Constructor to access an existing array.
|
OnDiskUpperTriangleMatrix(java.io.File filename,
int magicseed,
int extraheadersize,
int recordsize,
int matrixsize)
Constructor to access a new array.
|
| Modifier and Type | Method and Description |
|---|---|
private static int |
arraysize(int matrixsize)
Compute the size of the needed backing array from the matrix dimensions.
|
void |
close()
Close the matrix file.
|
private int |
computeOffset(int x,
int y)
Compute the offset within the file.
|
int |
getMatrixSize()
Query the size of the matrix.
|
java.nio.ByteBuffer |
getRecordBuffer(int x,
int y)
Get a record buffer
|
void |
resizeMatrix(int newsize)
Resize the matrix to cover newsize x newsize.
|
private static final long serialVersionUID
private static final int TRIANGLE_HEADER_SIZE
private int matrixsize
private OnDiskArray array
public OnDiskUpperTriangleMatrix(java.io.File filename,
int magicseed,
int extraheadersize,
int recordsize,
boolean writable)
throws java.io.IOException
filename - File namemagicseed - Magic numberextraheadersize - Size of extra header datarecordsize - Record sizewritable - flag to open writablejava.io.IOException - on IO errorspublic OnDiskUpperTriangleMatrix(java.io.File filename,
int magicseed,
int extraheadersize,
int recordsize,
int matrixsize)
throws java.io.IOException
filename - File namemagicseed - Magic numberextraheadersize - Size of extra header datarecordsize - Record sizematrixsize - Size of matrix to storejava.io.IOException - on IO errorspublic void resizeMatrix(int newsize)
throws java.io.IOException
newsize - New matrix size.java.io.IOException - on IO errorsprivate static int arraysize(int matrixsize)
matrixsize - size of the matrixprivate int computeOffset(int x,
int y)
x - First coordinatey - Second coordinatepublic java.nio.ByteBuffer getRecordBuffer(int x,
int y)
throws java.io.IOException
x - First coordinatey - Second coordinatejava.io.IOException - on IO errorspublic void close()
throws java.io.IOException
close in interface java.lang.AutoCloseablejava.io.IOException - on IO errorspublic int getMatrixSize()
Copyright © 2019 ELKI Development Team. License information.