public class SymmetricMatrix extends MutableAbstractMatrix implements MutableMatrix
Modifier and Type | Field and Description |
---|---|
protected int |
offset |
buffer, columns, rows, zeroPadded
Modifier | Constructor and Description |
---|---|
|
SymmetricMatrix(int length)
Creates a square, symmetric matrix with the given number of rows and columns.
|
|
SymmetricMatrix(int length,
boolean direct,
boolean zeroPadded)
Creates a square, symmetric matrix with the given number of rows and columns.
|
|
SymmetricMatrix(int offset,
int length,
boolean direct,
boolean zeroPadded)
Creates a square, symmetric matrix with the given number of rows and columns.
|
|
SymmetricMatrix(int offset,
int length,
MatrixBackingBuffer buffer,
boolean zeroPadded)
Creates a square, symmetric matrix with the given number of rows and columns.
|
protected |
SymmetricMatrix(int offset,
int length,
MatrixBackingBuffer buffer,
boolean zeroPadded,
boolean allocate) |
|
SymmetricMatrix(int length,
MatrixBackingBuffer buffer,
boolean zeroPadded)
Creates a square, symmetric matrix with the given number of rows and columns.
|
|
SymmetricMatrix(Matrix matrix,
MatrixBackingBuffer buffer,
boolean zeroPadded)
Creates a square, symmetric matrix with the data from the given matrix.
|
Modifier and Type | Method and Description |
---|---|
protected void |
allocate(MatrixBackingBuffer buffer)
Calls
MatrixBackingBuffer.allocate(int) on the used buffer. |
float |
get(int row,
int column)
Gets the value from
row and column . |
protected boolean |
isInvalid(int row,
int column) |
void |
set(int row,
int column,
float value)
Sets the given value.
|
protected int |
toIndex(int row,
int column) |
String |
toString() |
copy, copy, copy, copy, fill, set, setColumn, setRow
add, checkBounds, columnSum, enlarge, equals, get, getColumn, getNumberOfColumns, getNumberOfRows, getRow, hadamardMultiply, hashCode, isValidXORZeroPadded, isZeroPadded, multiply, multiply, rowSum, subtract, sum, translate, transpose
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
copy, copy, copy, fill, setColumn, setRow
add, columnSum, enlarge, getColumn, getNumberOfColumns, getNumberOfRows, getRow, hadamardMultiply, isZeroPadded, multiply, multiply, rowSum, subtract, sum, translate, transpose
public SymmetricMatrix(int length)
length
- rows == columns (square)public SymmetricMatrix(int length, MatrixBackingBuffer buffer, boolean zeroPadded)
buffer
- backing bufferlength
- rows == columns (square)zeroPadded
- zero padded?public SymmetricMatrix(int offset, int length, MatrixBackingBuffer buffer, boolean zeroPadded)
buffer
- backing bufferlength
- rows == columns (square)offset
- columns < this offset cannot be storedzeroPadded
- zero padded?public SymmetricMatrix(int offset, int length, boolean direct, boolean zeroPadded)
FloatBackingBuffer
. The matrix may be zero-padded.length
- rows == columns (square)offset
- columns < this offset cannot be storeddirect
- allocate the backing buffer directly/natively or on the Java heapzeroPadded
- zero padded?public SymmetricMatrix(int length, boolean direct, boolean zeroPadded)
FloatBackingBuffer
. The matrix may be zero-padded.length
- rows == columns (square)direct
- allocate the backing buffer directly/natively or on the Java heapzeroPadded
- zero padded?public SymmetricMatrix(Matrix matrix, MatrixBackingBuffer buffer, boolean zeroPadded)
FloatBackingBuffer
. The matrix may be zero-padded.matrix
- matrixbuffer
- backing bufferzeroPadded
- zero padded?protected SymmetricMatrix(int offset, int length, MatrixBackingBuffer buffer, boolean zeroPadded, boolean allocate)
protected void allocate(MatrixBackingBuffer buffer)
MutableAbstractMatrix
MatrixBackingBuffer.allocate(int)
on the used buffer.allocate
in class MutableAbstractMatrix
buffer
- bufferpublic float get(int row, int column)
Matrix
row
and column
.
If the matrix supports zero-padding, this method may return
0f
for undefined rows or columns.get
in interface Matrix
get
in class AbstractMatrix
row
- rowcolumn
- columnpublic void set(int row, int column, float value)
MutableMatrix
set
in interface MutableMatrix
set
in class MutableAbstractMatrix
row
- rowcolumn
- columnvalue
- valueprotected boolean isInvalid(int row, int column)
isInvalid
in class AbstractMatrix
protected int toIndex(int row, int column)
toIndex
in class AbstractMatrix
public String toString()
toString
in class AbstractMatrix
Copyright © 2011–2020 tagtraum industries incorporated. All rights reserved.