All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class cynosurex.math.Matrix

java.lang.Object
   |
   +----cynosurex.math.Matrix

public class Matrix
extends Object

Variable Index

 o columns
 o matrix
 o rows

Constructor Index

 o Matrix(double[][])
Create a new matrix based on the specified array.
 o Matrix(int, int)
Create a new matrix based on the specified rows and columns.
 o Matrix(int, int, double)
Create a new matrix based on the specified rows, columns, and initial value.

Method Index

 o addition(Matrix, Matrix)
This static method adds two matrices and produces the result in the thrid matrix.
 o getArray()
This method returns the matrix as a double array.
 o getColumns()
This method returns the number of columns in the matrix.
 o getDimension()
This method returns the Dimension of the matrix.
 o getRows()
This method returns the number of rows in the matrix.
 o getTranspose()
This method returns the transpose the current matrix.
 o getValueAt(int, int)
This method returns one of the value in the matrix.
 o identityMatrix(int)
This static method creates an identity matrix based on the specified dimension.
 o multiplication(Matrix, Matrix)
This static method multiplies two matrices and produces the result in the third matrix.
 o setValueAt(double, int, int)
This method sets one of the value in the matrix.
 o toString()
Overrides the super class method.
 o Transpose()
This method transposes the current matrix.

Variables

 o rows
 protected int rows
 o columns
 protected int columns
 o matrix
 protected double matrix[][]

Constructors

 o Matrix
 public Matrix(int rows,
               int columns)
Create a new matrix based on the specified rows and columns.

Parameters:
rows - number of rows in the matrix
columns - number of columns in the matrix
 o Matrix
 public Matrix(int rows,
               int columns,
               double initValue)
Create a new matrix based on the specified rows, columns, and initial value.

Parameters:
rows - number of rows in the matrix
columns - number of columns in the matrix
initValue - initial value of the matrix
 o Matrix
 public Matrix(double initValue[][])
Create a new matrix based on the specified array. Each column and row size must be the same or a MatrixDimensionMismatchException will be thrown.

Parameters:
initValue - array containing the initial values

Methods

 o addition
 public static Matrix addition(Matrix a,
                               Matrix b)
This static method adds two matrices and produces the result in the thrid matrix.

Parameters:
a - the first matrix
b - the second matrix
 o multiplication
 public static Matrix multiplication(Matrix a,
                                     Matrix b)
This static method multiplies two matrices and produces the result in the third matrix.

Parameters:
a - the first matrix
b - the second matrix
 o identityMatrix
 public static final Matrix identityMatrix(int dimension)
This static method creates an identity matrix based on the specified dimension.

Parameters:
dimension - dimension of the matrix to produce
 o getDimension
 public Dimension getDimension()
This method returns the Dimension of the matrix.

 o getColumns
 public int getColumns()
This method returns the number of columns in the matrix.

 o getRows
 public int getRows()
This method returns the number of rows in the matrix.

 o getValueAt
 public double getValueAt(int row,
                          int column)
This method returns one of the value in the matrix.

Parameters:
row - specifies the row of the value
column - specifies the column of the value
 o setValueAt
 public void setValueAt(double value,
                        int row,
                        int column)
This method sets one of the value in the matrix.

Parameters:
value - value to place in the matrix
row - specifies the row of the value
column - specifies the column of the value
 o getArray
 public double[][] getArray()
This method returns the matrix as a double array.

 o Transpose
 public void Transpose()
This method transposes the current matrix.

 o getTranspose
 public Matrix getTranspose()
This method returns the transpose the current matrix.

 o toString
 public String toString()
Overrides the super class method.

Overrides:
toString in class Object

All Packages  Class Hierarchy  This Package  Previous  Next  Index