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

## Class DenseMatrixStorage

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

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

      public class DenseMatrixStorage
      extends Object
      implements MatrixStorage

  Array based `MatrixStorage` implementation.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `DenseMatrixStorage()`
    `DenseMatrixStorage(double[][] data)`
    `DenseMatrixStorage(double[][] data, int stoMode)`
    `DenseMatrixStorage(double[] data, int rows)`
    `DenseMatrixStorage(double[] data, int rows, int stoMode)`
    `DenseMatrixStorage(int rows, int cols)`
    `DenseMatrixStorage(int rows, int cols, int stoMode)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `accessMode()`
    `int` | `columnSize()`
    `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()`
    `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`

- - ### Constructor Detail

    - #### DenseMatrixStorage

          public DenseMatrixStorage()

    - #### DenseMatrixStorage

          public DenseMatrixStorage(int rows,
                                    int cols)

      Parameters:
        `rows` - Amount of rows in the matrix.
        `cols` - Amount of columns in the matrix.

    - #### DenseMatrixStorage

          public DenseMatrixStorage(int rows,
                                    int cols,
                                    int stoMode)

    - #### DenseMatrixStorage

          public DenseMatrixStorage(double[][] data,
                                    int stoMode)

      Parameters:
        `data` - Backing data array.

    - #### DenseMatrixStorage

          public DenseMatrixStorage(double[][] data)

      Parameters:
        `data` - Backing data array.

    - #### DenseMatrixStorage

          public DenseMatrixStorage(double[] data,
                                    int rows,
                                    int stoMode)

      Parameters:
        `data` - Backing data array.

    - #### DenseMatrixStorage

          public DenseMatrixStorage(double[] data,
                                    int rows)

      Parameters:
        `data` - Backing data array.

  - ### Method Detail

    - #### 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.

    - #### 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`

    - #### 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`

    - #### 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()`

    - #### storageMode

          public int storageMode()

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

    - #### 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`

    - #### accessMode

          public int accessMode()

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

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

2022 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.12.0
Release Date | : January 10 2022