|
Multivalent API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectphelps.math.Matrix
Matrix manipulations: add, multiply, invert, transpose, determinant, Gauss-Jordan, simplex.
Matrix(double[][])
, Matrix(int,int)
, Matrix(Matrix)
, get(int,int)
, set(int,int, double)
, equals(Object)
transpose()
, invert()
, determinant()
add(Matrix)
, multiply(double)
, multiply(Matrix)
,
solveGaussJordan(int)
, maximize(double[])
Constructor Summary | |
---|---|
Matrix(double[][] x)
|
|
Matrix(int rows,
int cols)
Create a new matrix of the indicated number of m rows and columns. |
|
Matrix(Matrix m)
Create a new Matrix by copying (not sharing) the content of the one passed in. |
Method Summary | |
---|---|
Matrix |
add(Matrix x)
Return new matrix that is sum of this and passed matrix. |
double |
determinant()
Return the determinant of the matrix. |
boolean |
equals(java.lang.Object o)
|
double |
get(int row,
int col)
|
int |
getCols()
|
int |
getRows()
|
int |
hashCode()
|
Matrix |
invert()
Returns new matrix that is the inverse. |
double[] |
maximize(double[] maximize)
Treat matrix as a system of equations and maximize the passed program with the Simplex method. |
Matrix |
multiply(double s)
Return new matrix that is result of multiplying each element by the scalar s. |
Matrix |
multiply(Matrix x)
Return new matrix that is product of this and passed matrix. |
void |
set(int row,
int col,
double val)
|
double[] |
solveGaussJordan(int vars)
Treat the m x n matrix as a system of m equations in m unknowns, with the first m of n columns as coefficients, and the remaining n-m columns (typically n-m == 1) as constants. |
Matrix |
transpose()
Return a new matrix that is the transpose of this one. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Matrix(int rows, int cols)
public Matrix(double[][] x)
public Matrix(Matrix m)
Method Detail |
---|
public int getRows()
public int getCols()
public double get(int row, int col)
public void set(int row, int col, double val)
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public Matrix transpose()
public Matrix invert() throws java.lang.IllegalStateException
java.lang.IllegalStateException
- if matrix is not invertable.public double determinant() throws java.lang.IllegalStateException
java.lang.IllegalStateException
public Matrix add(Matrix x) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
- if passed matrix is of different dimension.public Matrix multiply(double s)
public Matrix multiply(Matrix x) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
- if passed matrix is of different dimension.public double[] solveGaussJordan(int vars)
public double[] maximize(double[] maximize)
|
Multivalent API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |