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

## Class ViewMatrixStorage

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

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

      public class ViewMatrixStorage
      extends Object
      implements MatrixStorage

  `MatrixStorage` implementation that delegates to parent matrix.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `ViewMatrixStorage()`
    `ViewMatrixStorage(MatrixStorage dlg, int rowOff, int colOff, int rows, int cols)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `int` | `accessMode()`
    `int` | `columnOffset()`
    `int` | `columnSize()`
    `int` | `columnsLength()`
    `double[]` | `data()` Gets underlying data, if `StorageOpsMetrics.isArrayBased()` returns `false` this method return copy of data.
    `MatrixStorage` | `delegate()`
    `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` | `rowOffset()`
    `int` | `rowSize()`
    `int` | `rowsLength()`
    `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

    - #### ViewMatrixStorage

          public ViewMatrixStorage()

    - #### ViewMatrixStorage

          public ViewMatrixStorage(MatrixStorage dlg,
                                   int rowOff,
                                   int colOff,
                                   int rows,
                                   int cols)

      Parameters:
        `dlg` - Backing parent storage.
        `rowOff` - Row offset to parent matrix.
        `colOff` - Column offset to parent matrix.
        `rows` - Amount of rows in the view.
        `cols` - Amount of columns in the view.

  - ### Method Detail

    - #### delegate

          public MatrixStorage delegate()

    - #### rowOffset

          public int rowOffset()

    - #### columnOffset

          public int columnOffset()

    - #### rowsLength

          public int rowsLength()

    - #### columnsLength

          public int columnsLength()

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

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

    - #### isArrayBased

          public boolean isArrayBased()

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

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

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

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

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

${current.year} Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.15.0
Release Date | : April 25 2023