|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectjava.util.AbstractCollection<Double>
csli.util.math.matrix.AbstractMatrix
public abstract class AbstractMatrix
Implements most Matrix methods. Derived classes only need to supply numRows, numCols, get, and (optionally) set.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from interface csli.util.math.matrix.Matrix |
|---|
Matrix.SingularMatrixException |
| Constructor Summary | |
|---|---|
AbstractMatrix()
|
|
| Method Summary | |
|---|---|
Matrix |
add(Matrix M)
|
Matrix |
addIP(Matrix M)
|
Matrix |
appendRight(Matrix M)
Create a new matrix which contains the original matrix A and the argument B side by side, as [A B]. |
Range |
cols()
|
boolean |
equals(Object obj)
|
Matrix |
fill(int top,
int left,
Matrix M)
Fill this matrix with the data from the matrix M, starting from coordinates top,left. |
double[] |
getCol(int j)
Return a double array containing the matrix's jth column. |
double[] |
getRow(int i)
Return a double array containing the matrix's ith row. |
Matrix |
inverse()
|
boolean |
isIdentity()
|
boolean |
isZero()
|
Iterator<Double> |
iterator()
|
Matrix |
leftDivide(Matrix M)
Matrix left-division: equal to A^(-1)*M. |
Matrix |
multiply(double c)
|
Matrix |
multiply(Matrix M)
Returns the product of this matrix with M. |
Matrix |
multiplyIP(double c)
|
Matrix |
ref()
row echelon form. |
Range |
rows()
|
Matrix |
rref()
Puts this matrix in reduced row echelon form using Gauss-Jordan elimination. |
void |
set(int i,
int j,
double val)
|
void |
setCol(int j,
double[] col)
Sets the jth column of the matrix equal to col. |
Matrix |
setDiag(double value)
Set all the diagonal entries of the matrix equal to value. |
void |
setRow(int i,
double[] row)
Sets the ith row of the matrix equal to row. |
int |
size()
|
Matrix |
submatrix(int top,
int left)
|
Matrix |
submatrix(int top,
int left,
int rows,
int cols)
|
Matrix |
subtract(Matrix M)
|
Matrix |
subtractIP(Matrix M)
|
String |
toString()
|
Matrix |
transpose()
|
| Methods inherited from class java.util.AbstractCollection |
|---|
add, addAll, clear, contains, containsAll, isEmpty, remove, removeAll, retainAll, toArray, toArray |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface csli.util.math.matrix.Matrix |
|---|
get, numCols, numRows |
| Methods inherited from interface java.util.Collection |
|---|
add, addAll, clear, contains, containsAll, hashCode, isEmpty, remove, removeAll, retainAll, toArray, toArray |
| Constructor Detail |
|---|
public AbstractMatrix()
| Method Detail |
|---|
public void set(int i,
int j,
double val)
set in interface Matrixpublic Range rows()
rows in interface Matrixpublic Range cols()
cols in interface Matrixpublic boolean isZero()
isZero in interface Matrixpublic boolean isIdentity()
isIdentity in interface Matrixpublic boolean equals(Object obj)
equals in interface Matrixequals in interface Collection<Double>equals in class Objectpublic Matrix multiply(Matrix M)
multiply in interface MatrixM -
public Matrix add(Matrix M)
add in interface Matrixpublic Matrix subtract(Matrix M)
subtract in interface Matrixpublic Matrix multiply(double c)
multiply in interface Matrixpublic Matrix addIP(Matrix M)
addIP in interface Matrixpublic Matrix subtractIP(Matrix M)
subtractIP in interface Matrixpublic Matrix multiplyIP(double c)
multiplyIP in interface Matrixpublic Matrix setDiag(double value)
Matrix
setDiag in interface Matrix
public Matrix submatrix(int top,
int left)
submatrix in interface Matrix
public Matrix submatrix(int top,
int left,
int rows,
int cols)
submatrix in interface Matrixpublic Matrix appendRight(Matrix M)
appendRight in interface MatrixM -
public Matrix inverse()
throws Matrix.SingularMatrixException
inverse in interface MatrixMatrix.SingularMatrixException
public Matrix leftDivide(Matrix M)
throws Matrix.SingularMatrixException
leftDivide in interface MatrixMatrix.SingularMatrixExceptionpublic Matrix rref()
rref in interface Matrixpublic Matrix ref()
ref in interface Matrixpublic double[] getRow(int i)
getRow in interface Matrixi -
public double[] getCol(int j)
getCol in interface Matrixj -
public void setRow(int i,
double[] row)
setRow in interface Matrixi - row -
public void setCol(int j,
double[] col)
setCol in interface Matrixj - col - public Matrix transpose()
transpose in interface Matrix
public Matrix fill(int top,
int left,
Matrix M)
fill in interface MatrixM - i - j -
public String toString()
toString in class AbstractCollection<Double>public int size()
size in interface Collection<Double>size in class AbstractCollection<Double>public Iterator<Double> iterator()
iterator in interface Iterable<Double>iterator in interface Collection<Double>iterator in class AbstractCollection<Double>
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||