Class cynosurex.math.Matrix
All Packages Class Hierarchy This Package Previous Next Index
Class cynosurex.math.Matrix
java.lang.Object
|
+----cynosurex.math.Matrix
- public class Matrix
- extends Object
-
columns
-
-
matrix
-
-
rows
-
-
Matrix(double[][])
- Create a new matrix based on the specified array.
-
Matrix(int, int)
- Create a new matrix based on the specified rows and columns.
-
Matrix(int, int, double)
- Create a new matrix based on the specified rows, columns, and
initial value.
-
addition(Matrix, Matrix)
- This static method adds two matrices and produces
the result in the thrid matrix.
-
getArray()
- This method returns the matrix as a double array.
-
getColumns()
- This method returns the number of columns in the matrix.
-
getDimension()
- This method returns the Dimension of the matrix.
-
getRows()
- This method returns the number of rows in the matrix.
-
getTranspose()
- This method returns the transpose the current matrix.
-
getValueAt(int, int)
- This method returns one of the value in the matrix.
-
identityMatrix(int)
- This static method creates an identity matrix based on
the specified dimension.
-
multiplication(Matrix, Matrix)
- This static method multiplies two matrices and produces
the result in the third matrix.
-
setValueAt(double, int, int)
- This method sets one of the value in the matrix.
-
toString()
- Overrides the super class method.
-
Transpose()
- This method transposes the current matrix.
rows
protected int rows
columns
protected int columns
matrix
protected double matrix[][]
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
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
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
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
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
identityMatrix
public final static Matrix identityMatrix(int dimension)
- This static method creates an identity matrix based on
the specified dimension.
- Parameters:
- dimension - dimension of the matrix to produce
getDimension
public Dimension getDimension()
- This method returns the Dimension of the matrix.
getColumns
public int getColumns()
- This method returns the number of columns in the matrix.
getRows
public int getRows()
- This method returns the number of rows in the matrix.
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
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
getArray
public double[][] getArray()
- This method returns the matrix as a double array.
Transpose
public void Transpose()
- This method transposes the current matrix.
getTranspose
public Matrix getTranspose()
- This method returns the transpose the current matrix.
toString
public String toString()
- Overrides the super class method.
- Overrides:
- toString in class Object
All Packages Class Hierarchy This Package Previous Next Index