org.apache.ignite.ml.math.primitives.vector

## Interface VectorStorage

- All Superinterfaces:
    Destroyable, Externalizable, Serializable, StorageOpsMetrics
  All Known Implementing Classes:
    DenseVectorStorage, SparseVectorStorage, VectorizedViewMatrixStorage, VectorViewStorage

      public interface VectorStorage
      extends Externalizable, StorageOpsMetrics, Destroyable

  Data storage support for `Vector`.

- - ### Method Summary

    All Methods Instance Methods Abstract Methods Default Methods
    Modifier and Type | Method and Description
    --- | ---
    `default double[]` | `data()` Gets underlying array if `StorageOpsMetrics.isArrayBased()` returns `true` and all values in vector are Numbers.
    `double` | `get(int i)` Gets element from vector by index and cast it to double.
    `<T extends Serializable> T` | `getRaw(int i)`
    `default Serializable[]` | `rawData()`
    `void` | `set(int i, double v)`
    `void` | `setRaw(int i, Serializable v)`
    `int` | `size()`

    - ### Methods inherited from interface java.io.Externalizable

      `readExternal, writeExternal`

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

      `isArrayBased, isDense, isNumeric`

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

      `destroy`

- - ### Method Detail

    - #### size

          int size()

    - #### get

          double get(int i)

      Gets element from vector by index and cast it to double.
      Parameters:
        `i` - Vector element index.
      Returns:
        Value obtained for given element index.

    - #### getRaw

          <T extends Serializable> T getRaw(int i)

      Type Parameters:
        `T` - Type of stored element in vector.
      Parameters:
        `i` - Vector element index.
      Returns:
        Value obtained for given element index.

    - #### set

          void set(int i,
                   double v)

      Parameters:
        `i` - Vector element index.
        `v` - Value to set at given index.

    - #### setRaw

          void setRaw(int i,
                      Serializable v)

      Parameters:
        `i` - Vector element index.
        `v` - Value to set at given index.

    - #### data

          default double[] data()

      Gets underlying array if `StorageOpsMetrics.isArrayBased()` returns `true` and all values in vector are Numbers. Returns `null` if in other cases.
      See Also:
        `StorageOpsMetrics.isArrayBased()`

    - #### rawData

          default Serializable[] rawData()

      Returns:
        Underlying array of serializable objects `StorageOpsMetrics.isArrayBased()` returns `true`. Returns `null` if in other cases.

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