public class DoubleMemoryDataStorage extends DataStorage
double
element type.DataStorage.AbstractIterator, DataStorage.Iterator
READ, READ_WRITE, WRITE
Modifier | Constructor and Description |
---|---|
|
DoubleMemoryDataStorage()
Default constructor.
|
protected |
DoubleMemoryDataStorage(DoubleMemoryDataStorage doubleMemoryDataStorage,
long offset,
long length)
Subsequence constructor.
|
Modifier and Type | Method and Description |
---|---|
protected void |
implCopyFrom(DataStorage dataStorage,
long size)
Copies the specified number of elements from another data storage to this data storage.
|
protected ArrayAccess |
implGetArray(int mode,
int startColumn,
int columns,
int rows)
Maps a block of data to a memory array when the data is treated as a matrix.
|
protected ArrayAccess |
implGetArray(int mode,
long offset,
int length)
Gets an array access to the data of this data storage when it is treated as a linear block.
|
protected long |
implGetSize()
Return the size of the whole data storage, not including sub-sequence settings.
|
protected ArrayAccess |
implGetTransposedArray(int mode,
int startColumn,
int columns,
int rows)
Maps a transposed block of data to a memory array when the data is treated as a matrix.
|
protected void |
implSetSize(long size)
Sets the size of the data storage.
|
protected DataStorage |
implSubsequence(long offset,
long length)
Implementation of getting a subsequence of this data storage.
|
boolean |
isCached()
Is this object cached in memory.
|
DataStorage.Iterator |
iterator(int mode,
long startPosition,
long endPosition)
Constructs a new iterator.
|
copyFrom, copyFrom, getArray, getArray, getOffset, getSize, getTransposedArray, isReadOnly, isSubsequenced, setReadOnly, setSize, subsequence
public DoubleMemoryDataStorage()
protected DoubleMemoryDataStorage(DoubleMemoryDataStorage doubleMemoryDataStorage, long offset, long length)
doubleMemoryDataStorage
- The originating data storage.offset
- The subsequence starting position.length
- The subsequence length.public boolean isCached()
DataStorage
isCached
in class DataStorage
true
if this object is cached in memory, false
if not.protected DataStorage implSubsequence(long offset, long length) throws ApfloatRuntimeException
DataStorage
implSubsequence
in class DataStorage
offset
- The subsequence starting position.length
- The subsequence length.ApfloatRuntimeException
protected void implCopyFrom(DataStorage dataStorage, long size) throws ApfloatRuntimeException
DataStorage
implCopyFrom
in class DataStorage
dataStorage
- The data storage where the data should be copied from.size
- The number of elements to be copied.ApfloatRuntimeException
protected long implGetSize()
DataStorage
implGetSize
in class DataStorage
protected void implSetSize(long size) throws ApfloatRuntimeException
DataStorage
implSetSize
in class DataStorage
size
- The size of the data storage.ApfloatRuntimeException
protected ArrayAccess implGetArray(int mode, long offset, int length) throws ApfloatRuntimeException
DataStorage
implGetArray
in class DataStorage
mode
- Access mode for the array access: DataStorage.READ
, DataStorage.WRITE
or both.offset
- Starting position of the array access in the data storage.length
- Number of accessible elements in the array access.ApfloatRuntimeException
protected ArrayAccess implGetArray(int mode, int startColumn, int columns, int rows) throws ApfloatRuntimeException
DataStorage
implGetArray
in class DataStorage
mode
- Whether the array is prepared for reading, writing or both. The value should be DataStorage.READ
, DataStorage.WRITE
or a combination of these.startColumn
- The starting column where data is read.columns
- The number of columns of data to read.rows
- The number of rows of data to read. This should be equivalent to n1, number of rows in the matrix.columns
x rows
containing the data.ApfloatRuntimeException
protected ArrayAccess implGetTransposedArray(int mode, int startColumn, int columns, int rows) throws ApfloatRuntimeException
DataStorage
implGetTransposedArray
in class DataStorage
mode
- Whether the array is prepared for reading, writing or both. The value should be DataStorage.READ
, DataStorage.WRITE
or a combination of these.startColumn
- The starting column where data is read.columns
- The number of columns of data to read.rows
- The number of rows of data to read. This should be equivalent to n1, number of rows in the matrix.columns
x rows
containing the transposed data.ApfloatRuntimeException
public DataStorage.Iterator iterator(int mode, long startPosition, long endPosition) throws IllegalArgumentException, IllegalStateException, ApfloatRuntimeException
DataStorage
startPosition
is less than or greater than endPosition
, correspondingly.iterator
in class DataStorage
mode
- Access mode for iterator: DataStorage.READ
, DataStorage.WRITE
or both.startPosition
- Starting position of iterator in the data set. For reverse access, the first element in the iterator is startPosition - 1
.endPosition
- End position of iterator in the data set. For forward access, the last accessible element in the iterator is endPosition - 1
.IllegalArgumentException
- If the requested area is out of bounds of the data storage.IllegalStateException
- If write access is requested for a read-only data storage.ApfloatRuntimeException
Copyright © 2018. All rights reserved.