edu.jhu.ece.iacl.jist.structures.matrix
Class Matrix3

java.lang.Object
  extended by edu.jhu.ece.iacl.jist.structures.matrix.Matrix3
All Implemented Interfaces:
MatrixX, java.lang.Cloneable

public class Matrix3
extends java.lang.Object
implements MatrixX, java.lang.Cloneable

Matrix 3d implementation Values are always stored as double.

Author:
Blake Lucas

Field Summary
 double[][][] mat
          Matrix 3d access This is not good encapsulation and will be deprectated in future iterations! Please use getters and setters when accessing matrix3d.
 
Constructor Summary
Matrix3(double[][][] m)
          Instantiates a new matrix3.
Matrix3(ImageData vol)
          Instantiates a new matrix3.
Matrix3(int d1, int d2, int d3)
          Instantiates a new matrix3.
Matrix3(int d1, int d2, int d3, double a)
          Instantiates a new matrix3.
 
Method Summary
 Matrix3 add(double a)
          Adds the.
 Matrix3 add(Matrix3 m)
          Adds the.
 Matrix3 clone()
           
 ImageData createVolume()
          Creates the volume.
 Matrix3 div(double a)
          Div.
 Matrix3 div(Matrix3 m)
          Div.
 double get(int i, int j, int k)
          Gets the.
 int getCols()
          Gets the cols.
 Matrix2[] getMatrix2d()
          Gets the matrix2d.
 Matrix2 getMatrix2d(int i)
          Gets the matrix2d.
 int getRows()
          Gets the rows.
 int getSlices()
          Gets the slices.
 Matrix3 mul(double a)
          Mul.
 Matrix3 mul(Matrix3 m)
          Mul.
 Matrix3 normalize()
          Normalize matrix.
 void printNonZeroString(int max)
          Debugging routine for printing non-zero matrix elements.
 void set(int i, int j, int k, double a)
          Sets the.
 Matrix3 sub(double a)
          Sub.
 Matrix3 sub(Matrix3 m)
          Sub.
 double[][][] toArray()
          To array.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mat

public double[][][] mat
Matrix 3d access This is not good encapsulation and will be deprectated in future iterations! Please use getters and setters when accessing matrix3d.

Constructor Detail

Matrix3

public Matrix3(int d1,
               int d2,
               int d3)
Instantiates a new matrix3.

Parameters:
d1 - the d1
d2 - the d2
d3 - the d3

Matrix3

public Matrix3(int d1,
               int d2,
               int d3,
               double a)
Instantiates a new matrix3.

Parameters:
d1 - the d1
d2 - the d2
d3 - the d3
a - the a

Matrix3

public Matrix3(ImageData vol)
Instantiates a new matrix3.

Parameters:
vol - the vol

Matrix3

public Matrix3(double[][][] m)
Instantiates a new matrix3.

Parameters:
m - the m
Method Detail

createVolume

public ImageData createVolume()
Creates the volume.

Returns:
the image data

getRows

public int getRows()
Gets the rows.

Returns:
the rows

getCols

public int getCols()
Gets the cols.

Returns:
the cols

getSlices

public int getSlices()
Gets the slices.

Returns:
the slices

toArray

public double[][][] toArray()
To array.

Returns:
the double[][][]

set

public void set(int i,
                int j,
                int k,
                double a)
Sets the.

Parameters:
i - the i
j - the j
k - the k
a - the a

get

public double get(int i,
                  int j,
                  int k)
Gets the.

Parameters:
i - the i
j - the j
k - the k
Returns:
the double

getMatrix2d

public Matrix2[] getMatrix2d()
Gets the matrix2d.

Returns:
the matrix2d

getMatrix2d

public Matrix2 getMatrix2d(int i)
Gets the matrix2d.

Parameters:
i - the i
Returns:
the matrix2d

add

public Matrix3 add(double a)
Adds the.

Parameters:
a - the a
Returns:
the matrix3

sub

public Matrix3 sub(double a)
Sub.

Parameters:
a - the a
Returns:
the matrix3

mul

public Matrix3 mul(double a)
Mul.

Parameters:
a - the a
Returns:
the matrix3

div

public Matrix3 div(double a)
Div.

Parameters:
a - the a
Returns:
the matrix3

add

public Matrix3 add(Matrix3 m)
Adds the.

Parameters:
m - the m
Returns:
the matrix3

sub

public Matrix3 sub(Matrix3 m)
Sub.

Parameters:
m - the m
Returns:
the matrix3

mul

public Matrix3 mul(Matrix3 m)
Mul.

Parameters:
m - the m
Returns:
the matrix3

clone

public Matrix3 clone()
Overrides:
clone in class java.lang.Object

div

public Matrix3 div(Matrix3 m)
Div.

Parameters:
m - the m
Returns:
the matrix3

normalize

public Matrix3 normalize()
Normalize matrix.

Returns:
new normalized matrix

toString

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

printNonZeroString

public void printNonZeroString(int max)
Debugging routine for printing non-zero matrix elements.

Parameters:
max - the max