pipe.dataLayer
Class DataLayer.Matrix

java.lang.Object
  |
  +--pipe.dataLayer.DataLayer.Matrix
Enclosing class:
DataLayer

public class DataLayer.Matrix
extends Object

dataLayer - Encapsulates entire Matrix, also contains functions to perform some manipulation TODO: Combined with IntMatrix

Version:
1.0
Author:
James D Bloom
See Also:

Matrix UML


Field Summary
static int OUT_OF_BOUNDS_ERROR
          Return value for function when specified index is out of bounds this should be an exception
 
Constructor Summary
DataLayer.Matrix(int[][] matrix)
          Construct Matrix from an integer array
DataLayer.Matrix(int i, int j)
          Construct Matrix and set size of internal array
 
Method Summary
 void add(DataLayer.Matrix matrixInput)
          Add a another matrix current matrix
 int get(int i, int j)
          Get specific value in matrix
 int[][] getIntArray()
          Return internal array of matrix
 void minus(DataLayer.Matrix matrixInput)
          Subtract a another matrix from current matrix
 void set(int i, int j, int value)
          Set specific value in matrix
 void setToZero()
          Set all values to zero
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

OUT_OF_BOUNDS_ERROR

public static final int OUT_OF_BOUNDS_ERROR
Return value for function when specified index is out of bounds this should be an exception

See Also:
Constant Field Values
Constructor Detail

DataLayer.Matrix

public DataLayer.Matrix(int i,
                        int j)
Construct Matrix and set size of internal array

Parameters:
i - First dimension of array i.e. int[i][j]
j - Second dimension of array i.e. int[i][j]

DataLayer.Matrix

public DataLayer.Matrix(int[][] matrix)
Construct Matrix from an integer array

Parameters:
matrix - Input integer array
Method Detail

setToZero

public void setToZero()
Set all values to zero


add

public void add(DataLayer.Matrix matrixInput)
Add a another matrix current matrix

Parameters:
matrixInput - Other matrix to add to current matrix

minus

public void minus(DataLayer.Matrix matrixInput)
Subtract a another matrix from current matrix

Parameters:
matrixInput - Other matrix to subtract from current matrix

set

public void set(int i,
                int j,
                int value)
Set specific value in matrix

Parameters:
i - First dimension of array i.e. int[i][j]
j - Second dimension of array i.e. int[i][j]
value - Value to set int[i][j] to

get

public int get(int i,
               int j)
Get specific value in matrix

Parameters:
i - First dimension of array i.e. int[i][j]
j - Second dimension of array i.e. int[i][j]
Returns:
Value from int[i][j]

getIntArray

public int[][] getIntArray()
Return internal array of matrix

Returns:
Return int[][] from inside matrix