|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--ru.sscc.matrix.RealMatrix | +--ru.sscc.matrix.RectBandedMatrix
Performs operations upon a Rectangular Banded Matrix. If n is a matrix rows number and k is a band width then the implemented matrix has dimensions n*(n+k-1). The band ocupies the diagonal starting from the matrix upper left corner and also (k-1) diagonals upper it. The representation of the matrix in the container is the following: k entries of the first row (from the left to the right), k entries of the second row, and so on.
A special case of a matrix, a Toeplitz matrix, is also implemented. A Toeplitz matrix contains identical entries along any main diagonal. To store it, only k entries are needed.
Field Summary | |
int |
bandWidth
The width of band |
Fields inherited from class ru.sscc.matrix.RealMatrix |
entries,
nColumns,
nRows |
Constructor Summary | |
RectBandedMatrix(int size,
int bandWidth,
boolean toeplitz)
Constructs an object with a clear matrix double[] type container. |
|
RectBandedMatrix(RealContainer entries,
int size,
int bandWidth,
boolean toeplitz)
Constructs an instance based on a user's real data container. |
Method Summary | |
double |
add(int i,
int j,
double value)
Adds the value of a matrix entry at the position (i,j). |
void |
compose(double a,
double b,
SymBandedMatrix A,
RealVector P,
SymBandedMatrix B)
Calculates a linear combination of two matrices by the formula a*A+b*H*P*H'. |
double |
get(int i,
int j)
Gets a value of a matrix entry at the position (i,j). |
boolean |
isToeplitz()
Tests the matrix to be Toeplitz's one. |
double |
mul(int i,
int j,
double value)
Multiplies a matrix entry at the position (i,j) by a value. |
void |
multiply(RealVector source,
RealVector target)
Multiplies the matrix by a column-vector. |
void |
multiplyT(RealVector source,
RealVector target)
Multiplies the transposed matrix by a column-vector. |
void |
reuse()
Allows to use the matrix in algebraic operations again. |
double |
set(int i,
int j,
double value)
Sets the value of a matrix entry at the position (i,j). |
Methods inherited from class ru.sscc.matrix.RealMatrix |
clone,
columnsNumber,
ensureAlgebraic,
ensureDimensions,
ensureDimensions,
ensureSquareMatrix,
getContainer,
lock,
multiplyNN,
multiplyNT,
multiplyTN,
multiplyTT,
relativeAccuracy,
rowsNumber,
unlock |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Field Detail |
public final int bandWidth
Constructor Detail |
public RectBandedMatrix(int size, int bandWidth, boolean toeplitz)
size
- a matrix dimensionbandWidth
- a matrix band widthtoeplitz
- is true for Toeplitz matrixpublic RectBandedMatrix(RealContainer entries, int size, int bandWidth, boolean toeplitz)
entries
- an upper half-band containersize
- a matrix dimensionbandWidth
- a matrix band widthtoeplitz
- is true for Toeplitz matrixMethod Detail |
public final boolean isToeplitz()
public void reuse()
public double get(int i, int j)
i
- a zero based row numberj
- a zero based column numberpublic double set(int i, int j, double value)
i
- a zero based row numberj
- a zero based column numbervalue
- a value to setpublic double add(int i, int j, double value)
i
- a zero based row numberj
- a zero based column numbervalue
- a value to setpublic double mul(int i, int j, double value)
i
- a zero based row numberj
- a zero based column numbervalue
- a value to setpublic void multiply(RealVector source, RealVector target)
source
- a source vector to multiplytarget
- a target vector to write the resultpublic void multiplyT(RealVector source, RealVector target)
source
- a source vector to multiplytarget
- a target vector to write the resultpublic void compose(double a, double b, SymBandedMatrix A, RealVector P, SymBandedMatrix B)
a
- a multiplierb
- a multiplierA
- a source symmetric banded matrixP
- a weight vector containing values of a diagonal matrix P
(null means calculation without weights)B
- a target symmetric banded matrix (may be the same as A)
having the same rows number and half-band width not less
than half-band width of A and band width of this matrix.
In other words the following should be true:
B.halfWidth >= max (A.halfWidth, this.bandWidth).
If this inequality is broken, the
IllegalArgumentException is thrown.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |