utilities
Class MatrixOperations

java.lang.Object
  |
  +--utilities.MatrixOperations

public class MatrixOperations
extends java.lang.Object


Constructor Summary
MatrixOperations()
           
 
Method Summary
static void add(int[][] a, int[][] b, int[][] c, int rows, int cols)
          Add two rows x cols integer matrices.
static void fastSquareMultiply(int[][] a, int[][] b, int[][] c, int n)
          Multiply two n x n integer matrices.
static void main(java.lang.String[] args)
           
static void multiply(int[][] a, int[][] b, int[][] c, int m, int n, int p)
          Multiply the m x n integer matrix a and the n x p integer matrix b to get the m x p integer matrix c.
static void squareMultiply(int[][] a, int[][] b, int[][] c, int n)
          Multiply two n x n integer matrices.
static void squareMultiply2(int[][] a, int[][] b, int[][] c, int n)
          Multiply two n x n integer matrices.
static void transpose(int[][] a, int rows)
          in-place transpose of matrix a[0:rows-1][0:rows-1]
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MatrixOperations

public MatrixOperations()
Method Detail

add

public static void add(int[][] a,
                       int[][] b,
                       int[][] c,
                       int rows,
                       int cols)
Add two rows x cols integer matrices. Computes c = a + b.

transpose

public static void transpose(int[][] a,
                             int rows)
in-place transpose of matrix a[0:rows-1][0:rows-1]

squareMultiply

public static void squareMultiply(int[][] a,
                                  int[][] b,
                                  int[][] c,
                                  int n)
Multiply two n x n integer matrices. Computes c = a * b.

squareMultiply2

public static void squareMultiply2(int[][] a,
                                   int[][] b,
                                   int[][] c,
                                   int n)
Multiply two n x n integer matrices. Computes c = a * b.

fastSquareMultiply

public static void fastSquareMultiply(int[][] a,
                                      int[][] b,
                                      int[][] c,
                                      int n)
Multiply two n x n integer matrices. Computes c = a * b.

multiply

public static void multiply(int[][] a,
                            int[][] b,
                            int[][] c,
                            int m,
                            int n,
                            int p)
Multiply the m x n integer matrix a and the n x p integer matrix b to get the m x p integer matrix c. Computes c = a * b.

main

public static void main(java.lang.String[] args)