Package mathvoyage
Class vmath.matrix
java.lang.Object
mathvoyage.vmath.matrix
- Enclosing class:
vmath
Contains functions to calculate the determinant, inverse, transpose, addition, subtraction, multiplication, and more of matrices.
- Author:
- Adib Sakhawat
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic MatrixReturns the addition of two matrices.static booleanCompares two matrices.static doubleReturns the determinant of a matrix.static Matrixeye(int n) Returns an identity matrix of the given size.static MatrixReturns the inverse of a matrix.static MatrixReturns the multiplication of a matrix and a number.static MatrixReturns the multiplication of two matrices.static Matrixones(int rows, int cols) Returns a matrix of ones of the given size.static MatrixReturns the power of a matrix.static MatrixReturns the subtraction of two matrices.static MatrixReturns the transpose of a matrix.static Matrixzeros(int rows, int cols) Returns a matrix of zeros of the given size.
-
Constructor Details
-
matrix
public matrix()
-
-
Method Details
-
add
Returns the addition of two matrices.- Parameters:
a- The first matrixb- The second matrix- Returns:
- The addition of the two matrices
-
subtract
Returns the subtraction of two matrices.- Parameters:
a- The first matrixb- The second matrix- Returns:
- The subtraction of the two matrices
-
multiply
Returns the multiplication of two matrices.- Parameters:
a- The first matrixb- The second matrix- Returns:
- The multiplication of the two matrices
-
multiply
Returns the multiplication of a matrix and a number.- Parameters:
m- The matrixx- The number- Returns:
- The multiplication of the matrix and the number
-
transpose
Returns the transpose of a matrix.- Parameters:
a- The matrix- Returns:
- The transpose of the matrix
-
inverse
Returns the inverse of a matrix.- Parameters:
a- The matrix- Returns:
- The inverse of the matrix
-
determinant
Returns the determinant of a matrix.- Parameters:
a- The matrix- Returns:
- The determinant of the matrix
-
zeros
Returns a matrix of zeros of the given size.- Parameters:
rows- The number of rowscols- The number of columns- Returns:
- The matrix of zeros
-
ones
Returns a matrix of ones of the given size.- Parameters:
rows- The number of rowscols- The number of columns- Returns:
- The matrix of ones
-
eye
Returns an identity matrix of the given size.- Parameters:
n- The size of the matrix- Returns:
- The identity matrix
-
compare
Compares two matrices.- Parameters:
a- The first matrixb- The second matrix- Returns:
- true if the matrices are equal, else false
-
pow
Returns the power of a matrix.- Parameters:
a- The matrixpower- The power- Returns:
- The power of the matrix
-