Class DoubleMemoryDataStorage

  • All Implemented Interfaces:
    Serializable

    public class DoubleMemoryDataStorage
    extends DataStorage
    Memory based data storage implementation for the double element type.
    Version:
    1.9.0
    Author:
    Mikko Tommila
    See Also:
    Serialized Form
    • Constructor Detail

      • DoubleMemoryDataStorage

        public DoubleMemoryDataStorage()
        Default constructor.
      • DoubleMemoryDataStorage

        protected DoubleMemoryDataStorage​(DoubleMemoryDataStorage doubleMemoryDataStorage,
                                          long offset,
                                          long length)
        Subsequence constructor.
        Parameters:
        doubleMemoryDataStorage - The originating data storage.
        offset - The subsequence starting position.
        length - The subsequence length.
    • Method Detail

      • isCached

        public boolean isCached()
        Description copied from class: DataStorage
        Is this object cached in memory.
        Specified by:
        isCached in class DataStorage
        Returns:
        true if this object is cached in memory, false if not.
      • implSubsequence

        protected DataStorage implSubsequence​(long offset,
                                              long length)
                                       throws ApfloatRuntimeException
        Description copied from class: DataStorage
        Implementation of getting a subsequence of this data storage. The validity of the arguments of this method do not need to be checked.
        Specified by:
        implSubsequence in class DataStorage
        Parameters:
        offset - The subsequence starting position.
        length - The subsequence length.
        Returns:
        Data storage that represents the specified part of this data storage.
        Throws:
        ApfloatRuntimeException
      • implCopyFrom

        protected void implCopyFrom​(DataStorage dataStorage,
                                    long size)
                             throws ApfloatRuntimeException
        Description copied from class: DataStorage
        Copies the specified number of elements from another data storage to this data storage. The validity of the arguments of this method do not need to be checked.
        Specified by:
        implCopyFrom in class DataStorage
        Parameters:
        dataStorage - The data storage where the data should be copied from.
        size - The number of elements to be copied.
        Throws:
        ApfloatRuntimeException
      • implGetSize

        protected long implGetSize()
        Description copied from class: DataStorage
        Return the size of the whole data storage, not including sub-sequence settings.
        Specified by:
        implGetSize in class DataStorage
        Returns:
        The size of the whole data storage, not including sub-sequence settings.
      • implGetArray

        protected ArrayAccess implGetArray​(int mode,
                                           long offset,
                                           int length)
                                    throws ApfloatRuntimeException
        Description copied from class: DataStorage
        Gets an array access to the data of this data storage when it is treated as a linear block. The validity of the arguments of this method do not need to be checked.
        Specified by:
        implGetArray in class DataStorage
        Parameters:
        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.
        Returns:
        The array access.
        Throws:
        ApfloatRuntimeException
      • implGetArray

        protected ArrayAccess implGetArray​(int mode,
                                           int startColumn,
                                           int columns,
                                           int rows)
                                    throws ApfloatRuntimeException
        Description copied from class: DataStorage
        Maps a block of data to a memory array when the data is treated as a matrix. The validity of the arguments of this method do not need to be checked.
        Specified by:
        implGetArray in class DataStorage
        Parameters:
        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.
        Returns:
        Access to an array of size columns x rows containing the data.
        Throws:
        ApfloatRuntimeException
      • implGetTransposedArray

        protected ArrayAccess implGetTransposedArray​(int mode,
                                                     int startColumn,
                                                     int columns,
                                                     int rows)
                                              throws ApfloatRuntimeException
        Description copied from class: DataStorage
        Maps a transposed block of data to a memory array when the data is treated as a matrix. The validity of the arguments of this method do not need to be checked.
        Specified by:
        implGetTransposedArray in class DataStorage
        Parameters:
        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.
        Returns:
        Access to an array of size columns x rows containing the transposed data.
        Throws:
        ApfloatRuntimeException