|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object cern.colt.PersistentObject cern.colt.matrix.impl.AbstractMatrix cern.colt.matrix.impl.AbstractMatrix2D cern.colt.matrix.DoubleMatrix2D cern.colt.matrix.impl.DenseDoubleMatrix2D LinAlg.ColtMatrix
Wrapper for cern.colt.matrix.impl.DenseDoubleMatrix2D
and
cern.colt.matrix.linalg.(Blas,Algebra,CholeskyDecomposition)
.
Rewrites the Blas operations in programming notation
plusEquals (+=)
and timesEquals (*=)
(from left and right) to maintain familiar coding syntax.
Only atomic operations fromm the Blas are wrapped. See
ExtendedColtMatrix
for the whole bewildering array.
Field Summary | |
static cern.colt.matrix.linalg.Blas |
blas
cern.colt.matrix.linalg.SeqBlas (non mulTithreaded) Blas object. |
static cern.colt.matrix.linalg.Algebra |
linAlg
cern.colt.matrix.linalg.Algebra object with default tolerances. |
Fields inherited from class cern.colt.matrix.impl.DenseDoubleMatrix2D |
elements |
Fields inherited from class cern.colt.matrix.impl.AbstractMatrix2D |
columns, columnStride, columnZero, rows, rowStride, rowZero |
Fields inherited from class cern.colt.matrix.impl.AbstractMatrix |
isNoView |
Constructor Summary | |
ColtMatrix(double[][] entries)
Entries derived from given double[][]. |
|
ColtMatrix(int rows,
int columns)
all entries zero. |
Method Summary | |
cern.colt.matrix.linalg.CholeskyDecomposition |
choleskyDecomposition()
Cholesky decomposition object arising from an attempted Cholesky decompostion of this . |
ColtMatrix |
choleskyRoot()
Returns the lower triangular matrix L with A=LL' in case A is symmetric and positive definite. |
ColtVector |
column(int j)
Returns the columns of this . |
ColtMatrix |
deepClone()
Returns a deep copy of this . |
ColtMatrix |
exponential(int k)
With A=this assumed square, computes the polyonomial
exp(A,k)=I+A+A^2/2!+...+A^{k-1}/(k-1)!,
Obviously this is the exponential of A only if
A is nilpotent with A^k=0 . |
static ColtMatrix |
identityMatrix(int n)
The identity matrix Id_n . |
ColtMatrix |
inverse()
Inverse of A=this if A is square, pseudoinverse otherwise. |
boolean |
isDiagonal()
|
boolean |
isEqual(ColtMatrix B)
Test for equality of dimension and entry by entry equality. |
boolean |
isLowerTriangular()
|
boolean |
isSymmetric()
|
boolean |
isTriangular()
|
boolean |
isUpperTriangular()
|
void |
leftTimesEquals(ColtMatrix A)
Implements the operation this=A*this . |
void |
leftTimesEquals(ColtMatrix A,
boolean transposeA)
Implements the operation this=A*this . |
ColtMatrix |
linearSystemSolution(ColtMatrix B)
Returns the solution matrix X of the linear equation this*X=B . |
ColtVector |
linearSystemSolution(ColtVector y)
Returns the solution vector x of the linear equation this*x=y. |
static void |
main(java.lang.String[] args)
Times the computation of nilpotent matrix exponentials. |
void |
plusEquals(ColtMatrix A)
Implements the operation this+=A . |
void |
plusEquals(double alpha,
ColtMatrix A)
Implements the operation this+=alpha*A . |
void |
rightTimesEquals(ColtMatrix A)
Implements the operation this=A*this . |
void |
rightTimesEquals(ColtMatrix A,
boolean transposeA)
Implements the operation this=this*A . |
ColtVector |
row(int i)
Returns the rows of this . |
void |
scale(double alpha)
Implements the operation this=alpha*this . |
void |
setFlags()
Selfchecks for symmetry, triangularity or diagonality and sets the corresponding flags. |
ColtMatrix |
transpose()
Returns the transpose of this . |
void |
transposeSelf()
Transposes this . |
Methods inherited from class cern.colt.matrix.impl.DenseDoubleMatrix2D |
assign, assign, assign, assign, assign, getQuick, haveSharedCellsRaw, index, like, like1D, like1D, setQuick, viewSelectionLike, zAssign8Neighbors, zMult, zMult, zSum |
Methods inherited from class cern.colt.matrix.DoubleMatrix2D |
aggregate, aggregate, cardinality, copy, equals, equals, forEachNonZero, get, getContent, getNonZeros, haveSharedCells, like, set, toArray, toString, view, viewColumn, viewColumnFlip, viewDice, viewPart, viewRow, viewRowFlip, viewSelection, viewSelection, viewSorted, viewStrides, zMult, zMult |
Methods inherited from class cern.colt.matrix.impl.AbstractMatrix2D |
_columnOffset, _columnRank, _rowOffset, _rowRank, checkBox, checkColumn, checkColumnIndexes, checkRow, checkRowIndexes, checkShape, checkShape, columns, rows, setUp, setUp, size, toStringShort, vColumnFlip, vDice, vPart, vRowFlip, vStrides |
Methods inherited from class cern.colt.matrix.impl.AbstractMatrix |
ensureCapacity, isView, trimToSize |
Methods inherited from class cern.colt.PersistentObject |
clone |
Methods inherited from class java.lang.Object |
finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final cern.colt.matrix.linalg.Algebra linAlg
public static final cern.colt.matrix.linalg.Blas blas
Constructor Detail |
public ColtMatrix(double[][] entries)
Entries derived from given double[][].
entries
- the matrix entries.public ColtMatrix(int rows, int columns)
Method Detail |
public static ColtMatrix identityMatrix(int n)
The identity matrix Id_n
.
n
- dimension.public boolean isUpperTriangular()
public boolean isLowerTriangular()
public boolean isTriangular()
public boolean isDiagonal()
public boolean isSymmetric()
public void setFlags()
public ColtMatrix deepClone()
Returns a deep copy of this
.
public ColtVector row(int i)
Returns the rows of this
.
i
- row index.public ColtVector column(int j)
Returns the columns of this
.
j
- column index.public boolean isEqual(ColtMatrix B)
public ColtMatrix transpose()
this
.
public void transposeSelf()
this
. The matrix must be square.
No new memory allocated.
public void scale(double alpha)
Implements the operation this=alpha*this
.
alpha
- scaling factor.public ColtMatrix inverse()
A=this
if A is square, pseudoinverse otherwise.
public void plusEquals(double alpha, ColtMatrix A)
Implements the operation this+=alpha*A
.
public void plusEquals(ColtMatrix A)
Implements the operation this+=A
.
public void leftTimesEquals(ColtMatrix A, boolean transposeA)
Implements the operation this=A*this
.
A is transposed if the parameter transposeA is set to true.
A
- multiplies this
on the left.public void leftTimesEquals(ColtMatrix A)
Implements the operation this=A*this
.
A
- multiplies this
on the left.public void rightTimesEquals(ColtMatrix A, boolean transposeA)
Implements the operation this=this*A
.
A is transposed if the parameter transposeA is set to true.
A
- multiplies this
on the right.public void rightTimesEquals(ColtMatrix A)
Implements the operation this=A*this
.
A
- multiplies this
on the left.public ColtMatrix linearSystemSolution(ColtMatrix B)
Returns the solution matrix X of the linear equation
this*X=B
. Exact solution if this
is
square, least squares solution otherwise. Simultaneous solution
of linear systems Ax=b, where b ranges over the columns of B.
The columns of X are the solution vectors.
B
- matrix of right hand sides (columns).public ColtVector linearSystemSolution(ColtVector y)
y
- right hand side.public cern.colt.matrix.linalg.CholeskyDecomposition choleskyDecomposition()
this
. Has some functionality in
addition to producing the lower triangular matrix L with A=LL' in case
A is symmetric and positive definite. See the
cern.colt.matrix.linalg.CholeskyDecomposition
documentation.
public ColtMatrix choleskyRoot()
public ColtMatrix exponential(int k)
With A=this
assumed square, computes the polyonomial
exp(A,k)=I+A+A^2/2!+...+A^{k-1}/(k-1)!,
A
only if
A
is nilpotent with A^k=0
.
Suboptimal implementation because of repeated calls to atomic methods.
It could be worth it to use the dgemm
BLAS methods.
k
- length of expansion of exponential series.public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |