Acme
Class Matrix

java.lang.Object
  extended by Acme.Matrix

public class Matrix
extends java.lang.Object


Constructor Summary
Matrix(int size)
           
Matrix(int rows, int cols)
           
Matrix(int rows, int cols, double value)
           
Matrix(Matrix o)
           
 
Method Summary
static Matrix add(Matrix a, Matrix b)
           
 boolean equals(java.lang.Object o)
           
 double get(int row, int col)
           
 int getCols()
           
 int getRows()
           
 int hashCode()
           
 double max()
           
 double mean()
           
 double min()
           
static Matrix multiply(double a, Matrix b)
           
static Matrix multiply(Matrix a, double b)
           
static Matrix multiply(Matrix a, Matrix b)
           
 void set(int row, int col, double value)
           
static Matrix solve(Matrix a, Matrix b)
           
static Matrix subtract(Matrix a, Matrix b)
           
 double sum()
           
 void swapCols(int c1, int c2)
           
 void swapRows(int r1, int r2)
           
 java.lang.String toString()
           
static Matrix transpose(Matrix m)
           
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Matrix

public Matrix(int rows,
              int cols)
       throws java.lang.ArithmeticException
Throws:
java.lang.ArithmeticException

Matrix

public Matrix(int rows,
              int cols,
              double value)
       throws java.lang.ArithmeticException
Throws:
java.lang.ArithmeticException

Matrix

public Matrix(int size)
       throws java.lang.ArithmeticException
Throws:
java.lang.ArithmeticException

Matrix

public Matrix(Matrix o)
       throws java.lang.ArithmeticException
Throws:
java.lang.ArithmeticException
Method Detail

getRows

public int getRows()

getCols

public int getCols()

get

public double get(int row,
                  int col)

set

public void set(int row,
                int col,
                double value)

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()
Overrides:
hashCode in class java.lang.Object

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

sum

public double sum()

mean

public double mean()

max

public double max()

min

public double min()

swapRows

public void swapRows(int r1,
                     int r2)

swapCols

public void swapCols(int c1,
                     int c2)

transpose

public static Matrix transpose(Matrix m)

add

public static Matrix add(Matrix a,
                         Matrix b)
                  throws java.lang.ArithmeticException
Throws:
java.lang.ArithmeticException

subtract

public static Matrix subtract(Matrix a,
                              Matrix b)
                       throws java.lang.ArithmeticException
Throws:
java.lang.ArithmeticException

multiply

public static Matrix multiply(Matrix a,
                              double b)

multiply

public static Matrix multiply(double a,
                              Matrix b)

multiply

public static Matrix multiply(Matrix a,
                              Matrix b)
                       throws java.lang.ArithmeticException
Throws:
java.lang.ArithmeticException

solve

public static Matrix solve(Matrix a,
                           Matrix b)
                    throws java.lang.ArithmeticException
Throws:
java.lang.ArithmeticException