|
||||||||
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.SymBandedMatrix
Performs operations upon a Symmetric Banded Matrix. A banded matrix is stored in the container by its upper half values. Exactly, if n*n-matrix has k upper non-zero diagonals then the matrix container will contain (k+1)*n entries. The value (k+1) is called here the half width. The ordering of the matrix values in the container is the following: (k+1) upper diagonal entries of the first row beginning from the diagonal entry, (k+1) upper diagonal entries of the second row, and so on. If upper diagonal entries number in a row is less than (k+1) (this sitiation appears in last k matrix rows), the missing entries may have arbitrary values.
A special case of a matrix, a Toeplitz matrix, is also implemented. A Toeplitz matrix contains identical entires along any main diagonal. To store it only (k+1) entries are needed. You can expand a Toeplitz matrix to non-Toeplitz one using the expand operation.
Field Summary | |
int |
halfWidth
A number of nonempty diagonals in upper half of matrix (the main diagonal is also counted). |
Fields inherited from class ru.sscc.matrix.RealMatrix |
entries,
nColumns,
nRows |
Constructor Summary | |
SymBandedMatrix(int size,
int halfWidth,
boolean toeplitz)
Construct an object with a clear double[] type matrix container. |
|
SymBandedMatrix(RealContainer entries,
int size,
int halfWidth,
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 |
expand()
Expands Toeplitz matrix to non-Toeplitz type (enlarges the matrix container and fills it by corresponding values). |
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. |
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(boolean toeplitz)
Allows to use the matrix in algebraic operations again and resets toeplitz tag to new value. |
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 halfWidth
Constructor Detail |
public SymBandedMatrix(int size, int halfWidth, boolean toeplitz)
size
- a matrix dimensionhalfWidth
- a width of matrix's half-band (k+1)toeplitz
- is true for Toeplitz matrixpublic SymBandedMatrix(RealContainer entries, int size, int halfWidth, boolean toeplitz)
entries
- an upper half-band containersize
- a matrix dimensionhalfWidth
- a width of matrix's half-band (k+1)toeplitz
- is true for Toeplitz matrixMethod Detail |
public final boolean isToeplitz()
public void reuse(boolean toeplitz)
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 expand()
public void multiply(RealVector source, RealVector target)
source
- a source vector to multiplytarget
- a target vector to write the resultpublic final void multiplyT(RealVector source, RealVector target)
source
- a source vector to multiplytarget
- a target vector to write the result
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |