Interface MatrixOperations

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      double[][] abs​(boolean[][] booleans)  
      double[][] addColumnVector​(double[][] matrix, double[][] colvector)  
      double[][] addRowVector​(double[][] matrix, double[][] rowvector)  
      void assignAllLessThan​(double[][] matrix, double lessthan, double assign)
      All values in matrix that is less than lessthan is assigned the value assign
      void assignAtIndex​(double[][] num, int[] range, int[] range1, double value)  
      void assignValuesToRow​(double[][] matrix, int row, int[] indicies, double[] values)  
      boolean[][] biggerThan​(double[][] matrix, double value)
      Returns a new matrix of booleans where true is set if the value in the matrix is bigger than value
      int[] concatenate​(int[] v1, int[] v2)  
      double[][] diag​(double[][] ds)  
      double dnrom​(double mu, double sigma)
      Generate random draw from Normal with mean mu and std.
      boolean[][] equal​(boolean[][] matrix1, boolean[][] matrix2)
      Returns a new matrix of booleans where true is set if the values to the two matrices are the same at that index
      double[][] exp​(double[][] v1)
      Destructively sets the values in matrix to its exponentiated value
      double[][] fillMatrix​(int rows, int cols, double fillvalue)  
      double[][] getValuesFromRow​(double[][] matrix, int row, int[] indicies)  
      double[][] maximum​(double[][] matrix, double maxval)
      Return a new matrix with the max value of either the value in the matrix or maxval otherwise
      double[][] mean​(double[][] matrix, int axis)  
      double[][] minus​(double[][] m1, double[][] m2)  
      boolean[][] negate​(boolean[][] booleans)
      Returns new matrix with booleans which are the negations of the input
      double[][] plus​(double[][] m1, double[][] m2)  
      int[] range​(int n)  
      int[] range​(int a, int b)  
      double[][] rnorm​(int m, int n)
      Returns new 2D matrix with normal random values with mean 0 and std.
      double[][] scalarDivide​(double[][] numerator, double denom)  
      double[][] scalarInverse​(double[][] m1)
      Returns scalar inverse of matrix
      double[][] scalarMult​(double[][] m1, double mul)  
      double[][] scalarMultiply​(double[][] m1, double[][] m2)  
      double[][] scalarPlus​(double[][] m1, double m2)  
      double[][] scalarPow​(double[][] matrix, double power)  
      double[][] square​(double[][] matrix)
      Returns a new matrix with the values of matrix squared
      double sum​(double[][] matrix)
      Returns sum of all values in the matrix
      double[][] sum​(double[][] matrix, int axis)  
      double[][] tile​(double[][] matrix, int rowtimes, int coltimes)  
      double[][] times​(double[][] a, double[][] b)  
      double[][] transpose​(double[][] matrix)  
    • Method Detail

      • mean

        double[][] mean​(double[][] matrix,
                        int axis)
      • transpose

        double[][] transpose​(double[][] matrix)
      • exp

        double[][] exp​(double[][] v1)
        Destructively sets the values in matrix to its exponentiated value
        Returns:
        same matrix with values exponentiated
      • scalarInverse

        double[][] scalarInverse​(double[][] m1)
        Returns scalar inverse of matrix
      • rnorm

        double[][] rnorm​(int m,
                         int n)
        Returns new 2D matrix with normal random values with mean 0 and std. dev 1
      • dnrom

        double dnrom​(double mu,
                     double sigma)
        Generate random draw from Normal with mean mu and std. dev sigma
        Returns:
        random sample
      • equal

        boolean[][] equal​(boolean[][] matrix1,
                          boolean[][] matrix2)
        Returns a new matrix of booleans where true is set if the values to the two matrices are the same at that index
        Returns:
        new matrix with booelans with values matrix1[i,j] == matrix2[i,j]
      • biggerThan

        boolean[][] biggerThan​(double[][] matrix,
                               double value)
        Returns a new matrix of booleans where true is set if the value in the matrix is bigger than value
        Returns:
        new matrix with booelans with values matrix1[i,j] == matrix2[i,j]
      • negate

        boolean[][] negate​(boolean[][] booleans)
        Returns new matrix with booleans which are the negations of the input
      • abs

        double[][] abs​(boolean[][] booleans)
      • sum

        double[][] sum​(double[][] matrix,
                       int axis)
      • sum

        double sum​(double[][] matrix)
        Returns sum of all values in the matrix
      • maximum

        double[][] maximum​(double[][] matrix,
                           double maxval)
        Return a new matrix with the max value of either the value in the matrix or maxval otherwise
      • assignAllLessThan

        void assignAllLessThan​(double[][] matrix,
                               double lessthan,
                               double assign)
        All values in matrix that is less than lessthan is assigned the value assign
      • square

        double[][] square​(double[][] matrix)
        Returns a new matrix with the values of matrix squared
      • scalarPow

        double[][] scalarPow​(double[][] matrix,
                             double power)
      • addColumnVector

        double[][] addColumnVector​(double[][] matrix,
                                   double[][] colvector)
      • addRowVector

        double[][] addRowVector​(double[][] matrix,
                                double[][] rowvector)
      • tile

        double[][] tile​(double[][] matrix,
                        int rowtimes,
                        int coltimes)
      • range

        int[] range​(int n)
      • range

        int[] range​(int a,
                    int b)
      • concatenate

        int[] concatenate​(int[] v1,
                          int[] v2)
      • scalarMultiply

        double[][] scalarMultiply​(double[][] m1,
                                  double[][] m2)
      • assignAtIndex

        void assignAtIndex​(double[][] num,
                           int[] range,
                           int[] range1,
                           double value)
      • getValuesFromRow

        double[][] getValuesFromRow​(double[][] matrix,
                                    int row,
                                    int[] indicies)
      • assignValuesToRow

        void assignValuesToRow​(double[][] matrix,
                               int row,
                               int[] indicies,
                               double[] values)
      • fillMatrix

        double[][] fillMatrix​(int rows,
                              int cols,
                              double fillvalue)
      • plus

        double[][] plus​(double[][] m1,
                        double[][] m2)
      • scalarPlus

        double[][] scalarPlus​(double[][] m1,
                              double m2)
      • minus

        double[][] minus​(double[][] m1,
                         double[][] m2)
      • scalarDivide

        double[][] scalarDivide​(double[][] numerator,
                                double denom)
      • scalarMult

        double[][] scalarMult​(double[][] m1,
                              double mul)
      • times

        double[][] times​(double[][] a,
                         double[][] b)
      • diag

        double[][] diag​(double[][] ds)