Class MathCRMatrixD

java.lang.Object
org.ddogleg.chainrule.MathCRMatrixD
All Implemented Interfaces:
MathCRMatrix<double[]>

public class MathCRMatrixD extends Object implements MathCRMatrix<double[]>
Various math operations that can be formed on CRMatrix
  • Constructor Details

    • MathCRMatrixD

      public MathCRMatrixD()
  • Method Details

    • mult

      public void mult(CRMatrix<double[]> a, CRMatrix<double[]> b, CRMatrix<double[]> out)
      Performs a matrix multiplication between a and b. Results are stored in 'out'. The shape of 'out' is dynamically computed and adjusted.
      Specified by:
      mult in interface MathCRMatrix<double[]>
    • addTo

      public void addTo(CRMatrix<double[]> dst, CRMatrix<double[]> src)
      Description copied from interface: MathCRMatrix
      Adds src into dst. Needed when a value feeds more than one consumer and the derivatives arriving from each have to be summed
      Specified by:
      addTo in interface MathCRMatrix<double[]>
    • diag

      public void diag(double value, CRMatrix<double[]> m)
      Description copied from interface: MathCRMatrix
      Fills the diagonal elements with the specified value
      Specified by:
      diag in interface MathCRMatrix<double[]>
    • fill

      public void fill(CRMatrix<double[]> m, double value)
      Description copied from interface: MathCRMatrix
      Fills every element with the specified value
      Specified by:
      fill in interface MathCRMatrix<double[]>
    • zero

      public void zero(CRArray<double[]> m, int length)
      Description copied from interface: MathCRMatrix
      Fills all elements in the array with zero
      Specified by:
      zero in interface MathCRMatrix<double[]>
    • random

      public void random(Random rand, double min, double max, CRMatrix<double[]> output)
      Fills the matrix with uniform random values.
      Specified by:
      random in interface MathCRMatrix<double[]>
      Parameters:
      rand - The random number generate
      min - Minimum value from RNG
      max - Maximum value from RNG
      output - Matrix to fill in with random values
    • random

      public CRMatrix<double[]> random(Random rand, double min, double max, int rows, int cols)
      Creates a new random matrix
      Specified by:
      random in interface MathCRMatrix<double[]>
    • random

      public CRArray<double[]> random(Random rand, double min, double max, int length)
      Description copied from interface: MathCRMatrix
      Creates a random array
      Specified by:
      random in interface MathCRMatrix<double[]>
    • isUncountable

      public boolean isUncountable(CRMatrix<double[]> m)
      Description copied from interface: MathCRMatrix
      Returns true if the matrix contains at least one uncountable number
      Specified by:
      isUncountable in interface MathCRMatrix<double[]>
    • createArray

      public CRArray<double[]> createArray(int length)
      Description copied from interface: MathCRMatrix
      Allocates a new array with the specified length
      Specified by:
      createArray in interface MathCRMatrix<double[]>
    • createMatrix

      public CRMatrix<double[]> createMatrix(int rows, int cols)
      Description copied from interface: MathCRMatrix
      Creates a new matrix with the specified shape
      Specified by:
      createMatrix in interface MathCRMatrix<double[]>