public class SymmetricBandMatrix extends SymmetricMatrix
k1 below the main diagonal,
the number of diagonals k2 above the main diagonal, plus the main diagonal.
bandwidth := k1 + k2 + 1offsetbuffer, columns, rows, zeroPadded| Modifier | Constructor and Description |
|---|---|
|
SymmetricBandMatrix(int length,
int bandwidth,
boolean direct,
boolean zeroPadded)
Creates a square, symmetric band matrix with the given number of rows and columns.
|
|
SymmetricBandMatrix(int length,
int bandwidth,
float defaultValue)
Creates a square, symmetric band matrix with the given number of rows and columns.
|
protected |
SymmetricBandMatrix(int length,
int bandwidth,
MatrixBackingBuffer buffer,
boolean zeroPadded,
float defaultValue,
boolean allocate) |
|
SymmetricBandMatrix(int length,
int bandwidth,
MatrixBackingBuffer buffer,
float defaultValue,
boolean zeroPadded)
Creates a square, symmetric band matrix with the given number of rows and columns.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
allocate(MatrixBackingBuffer buffer)
Calls
MatrixBackingBuffer.allocate(int) on the used buffer. |
void |
copy(float[] values)
Copies values from the provided array row by row to this matrix.
|
void |
copy(Matrix fromMatrix)
Copies values from another
Matrix to this matrix. |
void |
copy(Matrix fromMatrix,
int fromRow,
int fromColumn,
int toRow,
int toColumn,
int rows,
int columns)
Copies values from a defined offset from another matrix to a defined offset of this matrix.
|
void |
fill(float value)
Fills the matrix with the given values and adjusts the
defaultValue
returned for elements outside the band. |
float |
get(int row,
int column)
Gets the value from
row and column. |
void |
set(int row,
int column,
float value)
Sets the given value.
|
protected int |
toIndex(int row,
int column) |
String |
toString() |
isInvalidcopy, set, setColumn, setRowadd, checkBounds, columnSum, enlarge, equals, get, getColumn, getNumberOfColumns, getNumberOfRows, getRow, hadamardMultiply, hashCode, isValidXORZeroPadded, isZeroPadded, multiply, multiply, rowSum, subtract, sum, translate, transposeclone, finalize, getClass, notify, notifyAll, wait, wait, waitsetColumn, setRowadd, columnSum, enlarge, getColumn, getNumberOfColumns, getNumberOfRows, getRow, hadamardMultiply, isZeroPadded, multiply, multiply, rowSum, subtract, sum, translate, transposepublic SymmetricBandMatrix(int length,
int bandwidth,
float defaultValue)
length - rows == columns (square)bandwidth - bandwidth == k1 + k2 + 1, with k1 and k2 being the number of diagonals above and below the main diagonaldefaultValue - value to return for elements outside the bandpublic SymmetricBandMatrix(int length,
int bandwidth,
MatrixBackingBuffer buffer,
float defaultValue,
boolean zeroPadded)
length - rows == columns (square)bandwidth - bandwidth == k1 + k2 + 1, with k1 and k2 being the number of diagonals above and below the main diagonalbuffer - backing bufferdefaultValue - value to return for elements outside the bandzeroPadded - zero pad?public SymmetricBandMatrix(int length,
int bandwidth,
boolean direct,
boolean zeroPadded)
FloatBackingBuffer either directly/natively or on the Java heap.
The matrix may be zero-padded.length - rows == columns (square)bandwidth - bandwidth == k1 + k2 + 1, with k1 and k2 being the number of diagonals above and below the main diagonaldirect - allocate memory natively or on the Java heapzeroPadded - zero pad?protected SymmetricBandMatrix(int length,
int bandwidth,
MatrixBackingBuffer buffer,
boolean zeroPadded,
float defaultValue,
boolean allocate)
protected void allocate(MatrixBackingBuffer buffer)
MutableAbstractMatrixMatrixBackingBuffer.allocate(int) on the used buffer.allocate in class SymmetricMatrixbuffer - bufferpublic void fill(float value)
defaultValue
returned for elements outside the band.fill in interface MutableMatrixfill in class MutableAbstractMatrixvalue - valuepublic void copy(float[] values)
MutableMatrixcopy in interface MutableMatrixcopy in class MutableAbstractMatrixvalues - valuespublic void copy(Matrix fromMatrix)
MutableMatrixMatrix to this matrix.
If this matrix does not support the setting of certain elements (e.g. SymmetricBandMatrix),
the method fails silently, i.e. no values are copied, and no exception is raised.copy in interface MutableMatrixcopy in class MutableAbstractMatrixfromMatrix - other matrixpublic void copy(Matrix fromMatrix, int fromRow, int fromColumn, int toRow, int toColumn, int rows, int columns)
MutableMatrixSymmetricBandMatrix),
the method fails silently, i.e. no values are copied, and no exception is raised.copy in interface MutableMatrixcopy in class MutableAbstractMatrixfromMatrix - other matrixfromRow - row start offset of from matrixfromColumn - column start offset of from matrixtoRow - column start offset of this matrixtoColumn - column start offset of this matrixrows - number of rows to copycolumns - number of column to copypublic float get(int row,
int column)
Matrixrow and column.
If the matrix supports zero-padding, this method may return
0f for undefined rows or columns.get in interface Matrixget in class SymmetricMatrixrow - rowcolumn - columnpublic void set(int row,
int column,
float value)
MutableMatrixset in interface MutableMatrixset in class SymmetricMatrixrow - rowcolumn - columnvalue - valueprotected int toIndex(int row,
int column)
toIndex in class SymmetricMatrixpublic String toString()
toString in class SymmetricMatrixCopyright © 2011–2020 tagtraum industries incorporated. All rights reserved.