Interface MathCRMatrix<T>

All Known Implementing Classes:
MathCRMatrixD

public interface MathCRMatrix<T>
Specifies standard math operations on CRMatrix.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    addTo(CRMatrix<T> dst, CRMatrix<T> src)
    Adds src into dst.
    createArray(int length)
    Allocates a new array with the specified length
    createMatrix(int rows, int cols)
    Creates a new matrix with the specified shape
    void
    diag(double value, CRMatrix<T> m)
    Fills the diagonal elements with the specified value
    void
    fill(CRMatrix<T> m, double value)
    Fills every element with the specified value
    boolean
    Returns true if the matrix contains at least one uncountable number
    void
    mult(CRMatrix<T> a, CRMatrix<T> b, CRMatrix<T> out)
    Performs matrix multiplication.
    random(Random rand, double min, double max, int length)
    Creates a random array
    random(Random rand, double min, double max, int rows, int cols)
    Creates a matrix with random values
    void
    random(Random rand, double min, double max, CRMatrix<T> output)
    Fills the matrix with uniformly distributed random values.
    void
    zero(CRArray<T> m, int length)
    Fills all elements in the array with zero
    default void
    Fills all elements in the matrix with zero
  • Method Details

    • mult

      void mult(CRMatrix<T> a, CRMatrix<T> b, CRMatrix<T> out)
      Performs matrix multiplication. out = a*b
    • addTo

      void addTo(CRMatrix<T> dst, CRMatrix<T> src)
      Adds src into dst. Needed when a value feeds more than one consumer and the derivatives arriving from each have to be summed
    • diag

      void diag(double value, CRMatrix<T> m)
      Fills the diagonal elements with the specified value
    • zero

      default void zero(CRMatrix<T> m)
      Fills all elements in the matrix with zero
    • fill

      void fill(CRMatrix<T> m, double value)
      Fills every element with the specified value
    • zero

      void zero(CRArray<T> m, int length)
      Fills all elements in the array with zero
    • random

      void random(Random rand, double min, double max, CRMatrix<T> output)
      Fills the matrix with uniformly distributed random values.
      Parameters:
      rand - Random number generator
      min - Lower extent of random values
      max - Upper extent of random values
      output - Matrix which is filled
    • random

      CRMatrix<T> random(Random rand, double min, double max, int rows, int cols)
      Creates a matrix with random values
    • random

      CRArray<T> random(Random rand, double min, double max, int length)
      Creates a random array
    • isUncountable

      boolean isUncountable(CRMatrix<T> m)
      Returns true if the matrix contains at least one uncountable number
    • createArray

      CRArray<T> createArray(int length)
      Allocates a new array with the specified length
    • createMatrix

      CRMatrix<T> createMatrix(int rows, int cols)
      Creates a new matrix with the specified shape