org.apache.ignite.ml.math.primitives.matrix.storage

## Class SparseMatrixStorage

- java.lang.Object
- - org.apache.ignite.ml.math.primitives.matrix.storage.SparseMatrixStorage

- All Implemented Interfaces:
    Externalizable, Serializable, Destroyable, MatrixStorage, StorageConstants, StorageOpsMetrics

      public class SparseMatrixStorage
      extends Object
      implements MatrixStorage, StorageConstants

  Storage for sparse, local, on-heap matrix.
  See Also:
    Serialized Form

- - ### Field Summary

    - ### Fields inherited from interface org.apache.ignite.ml.math.StorageConstants

      `COLUMN_STORAGE_MODE, RANDOM_ACCESS_MODE, ROW_STORAGE_MODE, SEQUENTIAL_ACCESS_MODE, UNKNOWN_STORAGE_MODE`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SparseMatrixStorage()`
    `SparseMatrixStorage(int rows, int cols, int acsMode, int stoMode)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `accessMode()`
    `int` | `columnSize()`
    `void` | `compute(int row, int col, IgniteTriFunction<Integer,Integer,Double,Double> f)`
    `double[]` | `data()` Gets underlying data, if `StorageOpsMetrics.isArrayBased()` returns `false` this method return copy of data.
    `boolean` | `equals(Object o)`
    `double` | `get(int x, int y)`
    `int` | `hashCode()`
    `it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap<it.unimi.dsi.fastutil.ints.IntSet>` | `indexesMap()`
    `boolean` | `isArrayBased()` Checks if implementation is based on Java arrays.
    `boolean` | `isDense()` Checks if this implementation should be considered dense so that it explicitly represents every value.
    `void` | `readExternal(ObjectInput in)`
    `int` | `rowSize()`
    `void` | `set(int x, int y, double v)`
    `int` | `storageMode()`
    `void` | `writeExternal(ObjectOutput out)`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.apache.ignite.ml.math.primitives.matrix.MatrixStorage

      `isNumeric`

    - ### Methods inherited from interface org.apache.ignite.ml.math.Destroyable

      `destroy`

    - ### Methods inherited from interface org.apache.ignite.ml.math.StorageConstants

      `assertAccessMode, assertStorageMode`

- - ### Constructor Detail

    - #### SparseMatrixStorage

          public SparseMatrixStorage()

    - #### SparseMatrixStorage

          public SparseMatrixStorage(int rows,
                                     int cols,
                                     int acsMode,
                                     int stoMode)

  - ### Method Detail

    - #### storageMode

          public int storageMode()

      Specified by:
        `storageMode` in interface `MatrixStorage`
      Returns:
        Matrix elements storage mode.
      See Also:
        `StorageConstants`

    - #### accessMode

          public int accessMode()

      Specified by:
        `accessMode` in interface `MatrixStorage`
      Returns:
        Matrix access mode.
      See Also:
        `StorageConstants`

    - #### get

          public double get(int x,
                            int y)

      Specified by:
        `get` in interface `MatrixStorage`
      Parameters:
        `x` - Matrix row index.
        `y` - Matrix column index.
      Returns:
        Value corresponding to given row and column.

    - #### set

          public void set(int x,
                          int y,
                          double v)

      Specified by:
        `set` in interface `MatrixStorage`
      Parameters:
        `x` - Matrix row index.
        `y` - Matrix column index.
        `v` - Value to set at given row and column.

    - #### columnSize

          public int columnSize()

      Specified by:
        `columnSize` in interface `MatrixStorage`

    - #### rowSize

          public int rowSize()

      Specified by:
        `rowSize` in interface `MatrixStorage`

    - #### writeExternal

          public void writeExternal(ObjectOutput out)
                             throws IOException

      Specified by:
        `writeExternal` in interface `Externalizable`
      Throws:
        `IOException`

    - #### readExternal

          public void readExternal(ObjectInput in)
                            throws IOException,
                                   ClassNotFoundException

      Specified by:
        `readExternal` in interface `Externalizable`
      Throws:
        `IOException`
        `ClassNotFoundException`

    - #### isDense

          public boolean isDense()

      Checks if this implementation should be considered dense so that it explicitly represents every value.
      Specified by:
        `isDense` in interface `StorageOpsMetrics`

    - #### isArrayBased

          public boolean isArrayBased()

      Checks if implementation is based on Java arrays.
      Specified by:
        `isArrayBased` in interface `StorageOpsMetrics`

    - #### data

          public double[] data()

      Gets underlying data, if `StorageOpsMetrics.isArrayBased()` returns `false` this method return copy of data. The data must be adapted for `Blas`.
      Specified by:
        `data` in interface `MatrixStorage`
      See Also:
        `StorageOpsMetrics.isArrayBased()`

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### compute

          public void compute(int row,
                              int col,
                              IgniteTriFunction<Integer,Integer,Double,Double> f)

    - #### indexesMap

          public it.unimi.dsi.fastutil.ints.Int2ObjectArrayMap<it.unimi.dsi.fastutil.ints.IntSet> indexesMap()

2022 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.13.0
Release Date | : April 20 2022