org.apache.ignite.ml.math

## Class Blas

- java.lang.Object
- - org.apache.ignite.ml.math.Blas

- All Implemented Interfaces:
    Serializable

      public class Blas
      extends Object
      implements Serializable

  Useful subset of BLAS operations. This class is based on 'BLAS' class from Apache Spark MLlib.
  See Also:
    Serialized Form

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Blas()`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static void` | `axpy(Double a, Vector x, Vector y)` Performs y += a * x
    `static void` | `checkCardinality(Matrix a, Vector v)` Checks if Matrix A can be multiplied by vector v, if not CardinalityException is thrown.
    `void` | `copy(Vector x, Vector y)` Copies Vector x into Vector y.
    `static Double` | `dot(Vector x, Vector y)` Returns dot product of vectors x and y.
    `static void` | `gemm(double alpha, Matrix a, Matrix b, double beta, Matrix c)` For the moment we have no flags indicating if matrix is transposed or not.
    `static void` | `gemv(double alpha, Matrix a, Vector x, double beta, Vector y)` y := alpha * A * x + beta * y.
    `static void` | `scal(Double a, Vector x)` Performs in-place multiplication of vector x by a real scalar a.
    `static void` | `spr(Double alpha, DenseVector v, DenseVector u)` Adds alpha * v * v.t to a matrix in-place.
    `static void` | `spr(Double alpha, SparseVector v, DenseVector u)`
    `static void` | `syr(Double alpha, SparseVector x, DenseMatrix a)`

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

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Blas

          public Blas()

  - ### Method Detail

    - #### axpy

          public static void axpy(Double a,
                                  Vector x,
                                  Vector y)

      Performs y += a * x
      Parameters:
        `a` - Scalar a.
        `x` - Vector x.
        `y` - Vector y.

    - #### dot

          public static Double dot(Vector x,
                                   Vector y)

      Returns dot product of vectors x and y.
      Parameters:
        `x` - Vector x.
        `y` - Vector y.
      Returns:
        Dot product of x and y.

    - #### copy

          public void copy(Vector x,
                           Vector y)

      Copies Vector x into Vector y. (y = x)
      Parameters:
        `x` - Vector x.
        `y` - Vector y.

    - #### scal

          public static void scal(Double a,
                                  Vector x)

      Performs in-place multiplication of vector x by a real scalar a. (x = a * x)
      Parameters:
        `a` - Scalar a.
        `x` - Vector x.

    - #### spr

          public static void spr(Double alpha,
                                 DenseVector v,
                                 DenseVector u)

      Adds alpha * v * v.t to a matrix in-place. This is the same as BLAS's ?SPR.
      Parameters:
        `u` - the upper triangular part of the matrix in a [[DenseVector]](column major)

    - #### spr

          public static void spr(Double alpha,
                                 SparseVector v,
                                 DenseVector u)

    - #### syr

          public static void syr(Double alpha,
                                 SparseVector x,
                                 DenseMatrix a)

    - #### gemm

          public static void gemm(double alpha,
                                  Matrix a,
                                  Matrix b,
                                  double beta,
                                  Matrix c)

      For the moment we have no flags indicating if matrix is transposed or not. Therefore all dgemm parameters for transposition are equal to 'N'.

    - #### gemv

          public static void gemv(double alpha,
                                  Matrix a,
                                  Vector x,
                                  double beta,
                                  Vector y)

      y := alpha * A * x + beta * y.
      Parameters:
        `alpha` - Alpha.
        `a` - Matrix a.
        `x` - Vector x.
        `beta` - Beta.
        `y` - Vector y.

    - #### checkCardinality

          public static void checkCardinality(Matrix a,
                                              Vector v)
                                       throws CardinalityException

      Checks if Matrix A can be multiplied by vector v, if not CardinalityException is thrown.
      Parameters:
        `a` - Matrix A.
        `v` - Vector v.
      Throws:
        `CardinalityException`

2022 Copyright © Apache Software Foundation
| Follow @ApacheIgnite
Ignite Database and Caching Platform | : ver. 2.13.0
Release Date | : April 20 2022