|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objecthep.physics.matrix.SymmetricMatrix
public class SymmetricMatrix
A simple implementation of a symmetric matrix. A symmmetric matrix
is a square matrix for which e(i,j) == e(j,i).
| Constructor Summary | |
|---|---|
SymmetricMatrix(int size)
Creates a new instance of SymmetricMatrix with all elements set to zero. |
|
SymmetricMatrix(int size,
double[] initialValues,
boolean isLower)
Creates a new instance of SymmetricMatrix with the given initial values. |
|
SymmetricMatrix(Matrix mIn)
Construct a SymmetricMatrix by copying an existing matrix. |
|
| Method Summary | |
|---|---|
double[] |
asPackedArray(boolean isLower)
Returns the matrix as a packed array |
double |
det()
|
double |
diagonal(int index)
Returns the diagonal element for the given row/column |
double |
e(int x,
int y)
Returns a specific element |
int |
getNColumns()
Returns the number of columns |
int |
getNRows()
Returns the number of rows |
void |
incrementElement(int x,
int y,
double value)
Increment a specific element |
void |
invert()
Invert this matrix (into itself) |
void |
setElement(int x,
int y,
double value)
Set a specific element |
java.lang.String |
toString()
|
void |
transpose()
Tranpose this matrix (into itself) |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public SymmetricMatrix(int size)
size - The rank of the matrixpublic SymmetricMatrix(Matrix mIn)
public SymmetricMatrix(int size,
double[] initialValues,
boolean isLower)
size - The rank of the matrixinitialValues - The initial values for the matrixisLower - If true initial values must be m(0,0), m(1,0), m(1,1), ... otherwise m(0,0), m(0,1), m(0,2), ...| Method Detail |
|---|
public double[] asPackedArray(boolean isLower)
isLower - if true array is packed m(0,0), m(1,0), m(1,1),... else m(0,0), m(0,1), m(0,2), ...public int getNRows()
Matrix
getNRows in interface Matrixpublic int getNColumns()
Matrix
getNColumns in interface Matrixpublic double diagonal(int index)
public double e(int x,
int y)
e in interface Matrix
public void setElement(int x,
int y,
double value)
setElement in interface MutableMatrix
public void incrementElement(int x,
int y,
double value)
public double det()
public java.lang.String toString()
toString in class java.lang.Object
public void invert()
throws MatrixOp.IndeterminateMatrixException
MutableMatrix
invert in interface MutableMatrixMatrixOp.IndeterminateMatrixExceptionMatrixOp.inverse(Matrix,MutableMatrix)public void transpose()
MutableMatrix
transpose in interface MutableMatrixMatrixOp.transposed(Matrix,MutableMatrix)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||