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

## Class ViewMatrix

- java.lang.Object
- - org.apache.ignite.ml.math.primitives.matrix.AbstractMatrix
  - - org.apache.ignite.ml.math.primitives.matrix.impl.ViewMatrix

- All Implemented Interfaces:
    Externalizable, Serializable, Destroyable, MetaAttributes, Matrix, StorageOpsMetrics

      public class ViewMatrix
      extends AbstractMatrix

  Implements the rectangular view into the parent `Matrix`.
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.apache.ignite.ml.math.primitives.matrix.Matrix

      `Matrix.Element`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `ViewMatrix()` Constructor for `Externalizable` interface.
    `ViewMatrix(Matrix parent, int rowOff, int colOff, int rows, int cols)`
    `ViewMatrix(MatrixStorage sto, int rowOff, int colOff, int rows, int cols)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Matrix` | `copy()` Clones this matrix.
    `Matrix` | `like(int rows, int cols)` Creates new empty matrix of the same underlying class but of different size.
    `Vector` | `likeVector(int crd)` Creates new empty vector of compatible properties (similar or the same flavor) to this matrix.

    - ### Methods inherited from class org.apache.ignite.ml.math.primitives.matrix.AbstractMatrix

      `allSpliterator, assign, assign, assign, assign, assignColumn, assignRow, columnSize, compute, density, destroy, determinant, divide, equals, foldColumns, foldMap, foldRows, get, getCol, getElement, getMetaStorage, getRow, getStorage, getX, guid, hashCode, inverse, isArrayBased, isDense, likeIdentity, map, map, maxElement, maxValue, minElement, minus, minValue, nonZeroElements, nonZeroSpliterator, plus, plus, readExternal, rowSize, set, setColumn, setRow, setStorage, setX, storageGet, storageSet, sum, swapColumns, swapRows, times, times, times, toString, transpose, viewColumn, viewDiagonal, viewRow, writeExternal`

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

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

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

      `isNumeric`

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

      `getAttribute, hasAttribute, removeAttribute, setAttribute`

- - ### Constructor Detail

    - #### ViewMatrix

          public ViewMatrix()

      Constructor for `Externalizable` interface.

    - #### ViewMatrix

          public ViewMatrix(Matrix parent,
                            int rowOff,
                            int colOff,
                            int rows,
                            int cols)

      Parameters:
        `parent` - Backing parent `Matrix`.
        `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.

    - #### ViewMatrix

          public ViewMatrix(MatrixStorage sto,
                            int rowOff,
                            int colOff,
                            int rows,
                            int cols)

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

  - ### Method Detail

    - #### copy

          public Matrix copy()

      Clones this matrix.

      NOTE: new matrix will have the same flavor as the this matrix but a different ID.

      Specified by:
        `copy` in interface `Matrix`
      Overrides:
        `copy` in class `AbstractMatrix`
      Returns:
        New matrix of the same underlying class, the same size and the same values.

    - #### like

          public Matrix like(int rows,
                             int cols)

      Creates new empty matrix of the same underlying class but of different size.

      NOTE: new matrix will have the same flavor as the this matrix but a different ID.

      Parameters:
        `rows` - Number of rows for new matrix.
        `cols` - Number of columns for new matrix.
      Returns:
        New matrix of the same underlying class and size.

    - #### likeVector

          public Vector likeVector(int crd)

      Creates new empty vector of compatible properties (similar or the same flavor) to this matrix.
      Parameters:
        `crd` - Cardinality of the vector.
      Returns:
        Newly created empty vector "compatible" to this matrix.

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