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

## Class DenseVector

- java.lang.Object
- - org.apache.ignite.ml.math.primitives.vector.AbstractVector
  - - org.apache.ignite.ml.math.primitives.vector.impl.DenseVector

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

      public class DenseVector
      extends AbstractVector

  Basic implementation for vector.

  This is a trivial implementation for vector assuming dense logic, local on-heap JVM storage based on `double[]` array. It is only suitable for data sets where local, non-distributed execution is satisfactory and on-heap JVM storage is enough to keep the entire data set.

  See Also:
    Serialized Form

- - ### Nested Class Summary

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

      `Vector.Element`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DenseVector()`
    `DenseVector(double[] arr)`
    `DenseVector(double[] arr, boolean shallowCp)`
    `DenseVector(int size)`
    `DenseVector(Map<String,Object> args)`
    `DenseVector(Serializable[] data)`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `Vector` | `like(int crd)` Creates new empty vector of the same underlying class but of different cardinality.
    `Matrix` | `likeMatrix(int rows, int cols)` Creates new matrix of compatible flavor with given size.

    - ### Methods inherited from class org.apache.ignite.ml.math.primitives.vector.AbstractVector

      `all, allSpliterator, assign, assign, assign, assign, checkCardinality, checkCardinality, checkCardinality, checkIndex, compute, copy, copyOfRange, cross, destroy, divide, dot, dotSelf, equals, foldMap, foldMap, get, getDistanceSquared, getElement, getLengthSquared, getMetaStorage, getRaw, getRawX, getStorage, getX, guid, hashCode, increment, incrementX, isArrayBased, isDense, isNumeric, isZero, kNorm, logNormalize, logNormalize, makeElement, map, map, map, maxElement, maxValue, minElement, minus, minValue, nonZeroElements, nonZeroes, nonZeroSpliterator, normalize, normalize, plus, plus, readExternal, set, setRaw, setRawX, setStorage, setX, size, sort, storageGet, storageGetRaw, storageSet, storageSetRaw, sum, times, times, toMatrix, toMatrixPlusOne, viewPart, writeExternal`

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

      `asArray, labeled`

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

      `getAttribute, hasAttribute, removeAttribute, setAttribute`

- - ### Constructor Detail

    - #### DenseVector

          public DenseVector(Serializable[] data)

      Parameters:
        `data` - Data.

    - #### DenseVector

          public DenseVector(Map<String,Object> args)

      Parameters:
        `args` - Parameters for new Vector.

    - #### DenseVector

          public DenseVector()

    - #### DenseVector

          public DenseVector(int size)

      Parameters:
        `size` - Vector cardinality.

    - #### DenseVector

          public DenseVector(double[] arr,
                             boolean shallowCp)

      Parameters:
        `arr` - Source array.
        `shallowCp` - `true` to use shallow copy.

    - #### DenseVector

          public DenseVector(double[] arr)

      Parameters:
        `arr` - Source array.

  - ### Method Detail

    - #### likeMatrix

          public Matrix likeMatrix(int rows,
                                   int cols)

      Creates new matrix of compatible flavor with given size.
      Parameters:
        `rows` - Number of rows.
        `cols` - Number of columns.
      Returns:
        New matrix.

    - #### like

          public Vector like(int crd)

      Creates new empty vector of the same underlying class but of different cardinality.
      Parameters:
        `crd` - Cardinality for new vector.
      Returns:
        New vector.

2021 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.10.0
Release Date | : March 10 2021