|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object math.utils.Matrix
public class Matrix
class Matrix
Constructor Summary | |
---|---|
Matrix()
Construct a new Matrix, with 1 row and 1 column, initialized to 1. |
|
Matrix(double[][] coef)
Construct a new Matrix, initialized with the given coefficients. |
|
Matrix(int nbRows,
int nbCols)
init a new Matrix with nbRows rows, and nbCols columns. |
Method Summary | |
---|---|
double |
getCoef(int row,
int col)
return the coef. |
int |
getColumns()
return the number of columns. |
int |
getRows()
return the number of rows. |
Matrix |
getTranspose()
get the transposed matrix, without changing the inner coefficients of the original matrix. |
boolean |
isSquare()
return true if the matrix is square, i.e. |
double[] |
multiplyWith(double[] coefs)
return the result of the multiplication of the matrix with the given vector. |
double[] |
multiplyWith(double[] src,
double[] res)
return the result of the multiplication of the matrix with the given vector. |
Matrix |
multiplyWith(Matrix matrix)
return the result of the multiplication of the matriux with another one. |
void |
setCoef(int row,
int col,
double coef)
set the coef to the given value. |
void |
setToIdentity()
Fill the matrix with zeros everywhere, except on the main diagonal, filled with ones. |
double[] |
solve(double[] vector)
compute the solution of a linear system, using the Gauss-Jordan algorithm. |
String |
toString()
return a String representation of the elements of the Matrix |
void |
transpose()
transpose the matrix, changing the inner coefficients. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Matrix()
public Matrix(int nbRows, int nbCols)
public Matrix(double[][] coef)
Method Detail |
---|
public double getCoef(int row, int col)
public int getRows()
public int getColumns()
public boolean isSquare()
public void setCoef(int row, int col, double coef)
public Matrix multiplyWith(Matrix matrix)
public double[] multiplyWith(double[] coefs)
public double[] multiplyWith(double[] src, double[] res)
public void transpose()
public Matrix getTranspose()
public double[] solve(double[] vector)
public void setToIdentity()
public String toString()
toString
in class Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |