|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectsim.util.mantissa.linalg.Matrix
sim.util.mantissa.linalg.SquareMatrix
sim.util.mantissa.linalg.GeneralSquareMatrix
public class GeneralSquareMatrix
This class implements general square matrices of linear algebra.
This file is from the "Mantissa" Java software package found at http://www.spaceroots.org/software/mantissa/index.html. The license is included at the end of the source file.
Field Summary |
---|
Fields inherited from class sim.util.mantissa.linalg.Matrix |
---|
columns, data, rows |
Constructor Summary | |
---|---|
GeneralSquareMatrix(GeneralSquareMatrix s)
Copy constructor. |
|
GeneralSquareMatrix(int order)
Simple constructor. |
|
GeneralSquareMatrix(int order,
double[] data)
Simple constructor. |
Method Summary | |
---|---|
Matrix |
duplicate()
Polymorphic copy operator. |
double |
getDeterminant(double epsilon)
Get the determinant of the matrix. |
protected sim.util.mantissa.linalg.NonNullRange |
getRangeForColumn(int j)
Set a range to the non null part covered by a column. |
protected sim.util.mantissa.linalg.NonNullRange |
getRangeForRow(int i)
Set a range to the non null part covered by a row. |
void |
selfAdd(SquareMatrix s)
Add a matrix to the instance. |
void |
selfSub(SquareMatrix s)
Substract a matrix from the instance. |
void |
setElement(int i,
int j,
double value)
Set a matrix element. |
Matrix |
solve(Matrix b,
double epsilon)
Solve the A.X = B equation. |
Methods inherited from class sim.util.mantissa.linalg.SquareMatrix |
---|
getInverse, solve |
Methods inherited from class sim.util.mantissa.linalg.Matrix |
---|
add, getColumns, getElement, getRows, getTranspose, mul, mul, selfMul, sub, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public GeneralSquareMatrix(int order)
order
- order of the matrixpublic GeneralSquareMatrix(int order, double[] data)
order
- order of the matrixdata
- table of the matrix elements (stored row after row)public GeneralSquareMatrix(GeneralSquareMatrix s)
s
- square matrix to copyMethod Detail |
---|
public Matrix duplicate()
Matrix
Object.clone()
method, except that it has public access, it doesn't throw any
specific exception and it returns a Matrix.
duplicate
in class Matrix
Object.clone()
public void setElement(int i, int j, double value)
Matrix
setElement
in class Matrix
i
- row index, from 0 to rows - 1j
- column index, from 0 to cols - 1value
- value of the elementMatrix.getElement(int, int)
public void selfAdd(SquareMatrix s)
s
- square matrix to add
java.lang.IllegalArgumentException
- if there is a dimension mismatchpublic void selfSub(SquareMatrix s)
s
- square matrix to substract
java.lang.IllegalArgumentException
- if there is a dimension mismatchpublic double getDeterminant(double epsilon)
SquareMatrix
getDeterminant
in class SquareMatrix
epsilon
- threshold on matrix elements below which the
matrix is considered singular (this is used by the derived
classes that use a factorization to compute the determinant)
public Matrix solve(Matrix b, double epsilon) throws SingularMatrixException
SquareMatrix
solve
in class SquareMatrix
b
- second term of the equationepsilon
- threshold on matrix elements below which the
matrix is considered singular
SingularMatrixException
- if the matrix is singularprotected sim.util.mantissa.linalg.NonNullRange getRangeForRow(int i)
Matrix
getRangeForRow
in class Matrix
i
- index of the row
Matrix.getRangeForColumn(int)
protected sim.util.mantissa.linalg.NonNullRange getRangeForColumn(int j)
Matrix
getRangeForColumn
in class Matrix
j
- index of the column
Matrix.getRangeForRow(int)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |