|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||
java.lang.Object | +--Matrix
| Field Summary | |
private double[][] |
matrix
|
| Constructor Summary | |
Matrix(double[][] data)
Construct a new vector with the given double values. |
|
Matrix(int rowNum,
int colNum)
Construct a new matrix with rowNum rows and colNum columns. |
|
| Method Summary | |
Matrix |
add(Matrix other)
Adds the other matrix to the current matrix and returns the result in a new Matrix object. |
double |
elementAt(int i,
int j)
Returns the value in the i'th row and j’th column in the matrix.. |
AlgebraicVector |
gaussElimination()
Retruns a vector that is the solution of the set of equations defined by this augmented matrix. |
int |
getColNum()
Returns the number of columns in the matrix. |
AlgebraicVector |
getColVector(int i)
Returns the i'th column in the matrix as an AlgebraicVector object. |
int |
getRowNum()
Returns the number of rows in the matrix. |
AlgebraicVector[] |
getRowsAsVectors()
Returns the rows of the matrix as an array of AlgebraicVectors |
AlgebraicVector |
getRowVector(int i)
Returns the i'th row in the matrix as an AlgebraicVector object. |
AlgebraicVector |
mul(AlgebraicVector other)
Computes the multiplication of the current matrix with the given vector. |
Matrix |
mul(double scalar)
Computes the multiplication of the current matrix with the given scalar. |
Matrix |
mul(Matrix other)
Multiplies the other matrix to the current matrix and returns the result in a new Matrix object. |
void |
setElementAt(double value,
int i,
int j)
Sets the element in the i'th row and the j’th column to value. |
void |
setRowVector(AlgebraicVector vec,
int i)
Replace row i in the matrix with the given vector Assumes dimension of vector equal to the number of cols |
Matrix |
sub(Matrix other)
Substracts the other matrix to the current matrix and returns the result in a new Matrix object. |
private void |
swapRows(int i,
int j)
Swaps between 2 rows in the matrix. |
java.lang.String |
toString()
Returns a string representation of the vector in the following format: 2.0 3.1 5.4 |
| Methods inherited from class java.lang.Object |
|
| Field Detail |
private double[][] matrix
| Constructor Detail |
public Matrix(int rowNum,
int colNum)
rowNum - Number of RowscolNum - Number of colspublic Matrix(double[][] data)
data - A 2-dimentionl array of doubles| Method Detail |
public double elementAt(int i,
int j)
i - row ij - col j
public void setElementAt(double value,
int i,
int j)
value - value you want inserted ini - row ij - col jpublic int getRowNum()
public int getColNum()
public AlgebraicVector getRowVector(int i)
i - the row in the matrix you want back as vectorpublic AlgebraicVector getColVector(int i)
i - the col in the matrix you want back as vectorpublic AlgebraicVector[] getRowsAsVectors()
public Matrix add(Matrix other)
other - the matrix you want tho addpublic Matrix sub(Matrix other)
other - the matrix you want tho substractpublic Matrix mul(Matrix other)
other - the matrix you want to multiplypublic Matrix mul(double scalar)
scalar - a scalar you want to multiplypublic AlgebraicVector mul(AlgebraicVector other)
other - a vector you want to multiply
public void setRowVector(AlgebraicVector vec,
int i)
vec - AlgebraicVector containing the vector to seti - The row number to replace with the given vector
private void swapRows(int i,
int j)
i - row ij - row jpublic AlgebraicVector gaussElimination()
public java.lang.String toString()
toString in class java.lang.Object
|
|||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||