Class AbstractMapToSparseMatrixWrapper

All Implemented Interfaces:
Serializable, Cloneable, Comparable<Matrix>, HasMetaData, BaseMatrix, BooleanCalculations, CanPerformCalculations, DenseMatrix, DenseMatrix2D, DenseMatrixMultiD, BasicDoubleCalculations, DoubleCalculations, BasicEntrywiseDoubleCalculations, CreatorDoubleCalculations, EntrywiseDoubleCalculations, HyperbolicDoubleCalculations, MiscEntrywiseDoubleCalculations, RoundingDoubleCalculations, TrigonometricDoubleCalculations, DecompositionDoubleCalculations, DiscretizeCalculations, GeneralDoubleCalculations, MiscGeneralDoubleCalculations, MissingValueDoubleCalculations, StatisticalDoubleCalculations, BaseGenericMatrix<Object>, DenseGenericMatrix<Object>, DenseGenericMatrix2D<Object>, DenseGenericMatrixMultiD<Object>, GenericMatrix<Object>, GenericMatrix2D<Object>, GenericMatrixMultiD<Object>, SparseGenericMatrix<Object>, SparseGenericMatrix2D<Object>, SparseGenericMatrixMultiD<Object>, BaseMatrixProperties, Clearable, Conversions, CoordinateFunctions, CoreObject, DistanceMeasures, ExtendedMatrixProperties, GettersAndSetters, HasDescription, HasGUIObject, HasId, HasLabel, Wrapper<Map<Coordinates,Object>>, IntCalculations, Matrix, Matrix2D, MatrixMultiD, BaseObjectMatrix, ObjectCalculations, DenseObjectMatrix, DenseObjectMatrix2D, DenseObjectMatrixMultiD, ObjectMatrix, ObjectMatrix2D, ObjectMatrixMultiD, SparseObjectMatrix, SparseObjectMatrix2D, SparseObjectMatrixMultiD, SparseMatrix, SparseMatrix2D, SparseMatrixMultiD, StringCalculations
Direct Known Subclasses:
SerializedSparseObjectMatrix

public abstract class AbstractMapToSparseMatrixWrapper extends AbstractSparseObjectMatrix implements Wrapper<Map<Coordinates,Object>>
See Also:
  • Field Details

    • serialVersionUID

      private static final long serialVersionUID
      See Also:
    • defaultValue

      private final Object defaultValue
    • values

      private final Map<Coordinates,Object> values
    • maximumNumberOfEntries

      private int maximumNumberOfEntries
  • Constructor Details

    • AbstractMapToSparseMatrixWrapper

      public AbstractMapToSparseMatrixWrapper(Map<Coordinates,Object> map, Matrix m)
    • AbstractMapToSparseMatrixWrapper

      public AbstractMapToSparseMatrixWrapper(Map<Coordinates,Object> map, long... size)
  • Method Details

    • getMap

      public final Map<Coordinates,Object> getMap()
    • getWrappedObject

      public final Map<Coordinates,Object> getWrappedObject()
      Description copied from interface: Wrapper
      Returns the object that is wrapped inside the wrapper
      Specified by:
      getWrappedObject in interface Wrapper<Map<Coordinates,Object>>
      Returns:
      the inner object
    • setWrappedObject

      public final void setWrappedObject(Map<Coordinates,Object> object)
    • getObject

      public final Object getObject(long... coordinates)
      Specified by:
      getObject in interface GenericMatrixMultiD<Object>
    • containsCoordinates

      public final boolean containsCoordinates(long... coordinates)
      Description copied from interface: CoordinateFunctions
      Determines if the given Coordinates are part of the Matrix. If the Matrix is dense, true is returned for all Coordinates smaller than the Matrix's size. For sparse Matrices, this function checks if the coordinates are actually stored in the matrix or not.
      Specified by:
      containsCoordinates in interface CoordinateFunctions
      Parameters:
      coordinates - The coordinates to check
      Returns:
      a boolean stating if the coordinates are part of the Matrix
    • getAsDouble

      public final double getAsDouble(long... coordinates)
      Description copied from interface: GettersAndSetters
      Returns a double representation of an entry in the matrix. The stored value will be converted to a double as good as possible.
      Specified by:
      getAsDouble in interface GettersAndSetters
      Overrides:
      getAsDouble in class AbstractObjectMatrix
      Parameters:
      coordinates - location of the entry
      Returns:
      a double representation of the entry @
    • setAsDouble

      public final void setAsDouble(double v, long... coordinates)
      Description copied from interface: GettersAndSetters
      Sets an entry in the matrix to a double value. If the matrix cannot store double values, the value will be represented as good as possible.
      Specified by:
      setAsDouble in interface GettersAndSetters
      Overrides:
      setAsDouble in class AbstractObjectMatrix
      Parameters:
      v - double value
      coordinates - location of the entry @
    • setObject

      public final void setObject(Object o, long... coordinates)
      Specified by:
      setObject in interface GenericMatrixMultiD<Object>
      Overrides:
      setObject in class AbstractGenericMatrix<Object>
    • getMaximumNumberOfEntries

      public final int getMaximumNumberOfEntries()
    • getValueCount

      public final long getValueCount()
      Specified by:
      getValueCount in interface BaseMatrixProperties
      Overrides:
      getValueCount in class AbstractMatrix
    • availableCoordinates

      public final Iterable<long[]> availableCoordinates()
      Description copied from interface: CoordinateFunctions
      Returns an Iterator that only goes over the coordinates in the Matrix that are stored. For most Matrices, this is the same as allCoordinates(). For sparse Matrices, it iterates only over the entries in it.
      Specified by:
      availableCoordinates in interface CoordinateFunctions
      Returns:
      Iterable over the saved entries in a Matrix.
    • setMaximumNumberOfEntries

      public final void setMaximumNumberOfEntries(int maximumNumberOfEntries)