public class Matrix3x3DiagBlock extends Matrix3x3Block
Matrix.Partition, Matrix.WriteFormat
INDEFINITE, POSITIVE_DEFINITE, SPD, SYMMETRIC
Constructor and Description |
---|
Matrix3x3DiagBlock()
Creates a new Matrix3x3DiagBlock.
|
Matrix3x3DiagBlock(double m00,
double m11,
double m22)
Creates a new Matrix3x3DiagBlock with specufied diagnonal elements.
|
Modifier and Type | Method and Description |
---|---|
void |
addNumNonZerosByCol(int[] offsets,
int idx,
Matrix.Partition part)
Adds the number of non-zero entries in each column of this block matrix to
the current values stored in the array
offsets , starting
at the location specified by idx . |
void |
addNumNonZerosByRow(int[] offsets,
int idx,
Matrix.Partition part)
Adds the number of non-zero entries in each row of this block matrix to
the current values stored in the array
offsets , starting
at the location specified by idx . |
int |
getBlockCCSIndices(int[] rowIdxs,
int rowOff,
int[] offsets,
Matrix.Partition part) |
int |
getBlockCCSValues(double[] vals,
int[] offsets,
Matrix.Partition part)
Stores the values of non-zero entries for this matrix block.
|
int |
getBlockCRSIndices(int[] colIdxs,
int colOff,
int[] offsets,
Matrix.Partition part)
Stores the column indices of the non-zero entries for this matrix block.
|
int |
getBlockCRSValues(double[] vals,
int[] offsets,
Matrix.Partition part)
Stores the values of non-zero entries for this matrix block.
|
void |
mulAdd(double[] y,
int yIdx,
double[] x,
int xIdx)
Pre-multiplies a column vector by this matrix block and adds the result to
a set of existing values.
|
void |
mulTransposeAdd(double[] y,
int yIdx,
double[] x,
int xIdx)
Post-multiplies a row vector by this matrix block and adds the result to a
set of existing values.
|
int |
numNonZeroVals()
Returns the number of non-zero values in this matrix object.
|
int |
numNonZeroVals(Matrix.Partition part,
int numRows,
int numCols)
Returns the number of non-zero values for a specified partition of a
principal sub-matrix of this matrix delimited by the first
numRows rows and the first numCols columns. |
void |
set(double m00,
double m11,
double m22) |
void |
set(int i,
int j,
double val)
Sets a single element of this matrix.
|
boolean |
valueIsNonZero(int i,
int j)
Returns true if the value at the specified location is structurally
non-zero.
|
add, clone, createTranspose, down, getBlockCol, getBlockNumber, getBlockRow, next, scaledAdd, setBlockCol, setBlockNumber, setBlockRow, setDown, setNext, sub
add, add, addDiagonal, addObj, addOuterProduct, addOuterProduct, addScaledOuterProduct, addScaledOuterProduct, crossProduct, crossProduct, epsilonEquals, factorQR, fastInvert, inverseTransform, inverseTransform, invert, invert, main, mul, mul, mulCols, mulCols, mulInverse, mulInverseBoth, mulInverseLeft, mulInverseRight, mulRows, mulRows, mulTranspose, mulTransposeBoth, mulTransposeLeft, mulTransposeRight, negate, outerProduct, permuteColumns, permuteColumns, permuteRows, permuteRows, scale, scale, scaledAdd, scaledAdd, scaledAddObj, scaleObj, set, set, setColumns, setDiagonal, setDiagonal, setDiagonal, setDiagonal, setRandom, setRandom, setRandom, setRows, setSkewSymmetric, setSymmetric, setZero, sub, sub, transform, transform, transpose
colSize, determinant, epsilonEquals, equals, factorQR, frobeniusNorm, get, get, getColumn, getColumn, getColumn, getRow, getRow, getRow, infinityNorm, isIdentity, isSymmetric, mul, mul, mul, mulAdd, mulAdd, mulInverse, mulInverse, mulInverseTranspose, mulInverseTranspose, mulTranspose, mulTranspose, mulTransposeAdd, mulTransposeLeftAdd, mulTransposeRightAdd, negate, negateColumn, negateRow, oneNorm, orthogonalDeterminant, rowSize, scaleColumn, scaleRow, set, set, set, setColumn, setColumn, setIdentity, setRow, setRow, solve, solveTranspose, trace, transpose
add, checkConsistency, set, set, set, setCCSValues, setColumn, setCRSValues, setRow, setSubMatrix
containsNaN, epsilonEquals, equals, frobeniusNormSquared, get, getCCSIndices, getCCSIndices, getCCSIndices, getCCSValues, getCCSValues, getCCSValues, getColumn, getCRSIndices, getCRSIndices, getCRSIndices, getCRSValues, getCRSValues, getCRSValues, getDefaultFormat, getRow, getSize, getSubMatrix, hasNaN, idString, isFixedSize, isWritable, maxNorm, mul, mul, mulAdd, mulAdd, mulAdd, mulTranspose, mulTranspose, mulTranspose, mulTransposeAdd, mulTransposeAdd, mulTransposeAdd, scan, scan, setCRSValues, setDefaultFormat, setSize, toString, toString, toString, write, write, write, write, write, write, write, writeToFile
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
mulAdd, mulTransposeLeftAdd, mulTransposeRightAdd, negate, scale, setZero
set, set, setColumn, setColumn, setRow, setRow, setSubMatrix
checkConsistency, colSize, determinant, epsilonEquals, equals, frobeniusNorm, frobeniusNormSquared, get, get, getCCSIndices, getCCSIndices, getCCSIndices, getCCSValues, getCCSValues, getCCSValues, getColumn, getColumn, getColumn, getCRSIndices, getCRSIndices, getCRSIndices, getCRSValues, getCRSValues, getCRSValues, getRow, getRow, getRow, getSize, getSubMatrix, infinityNorm, isFixedSize, isSymmetric, maxNorm, mul, mul, mul, mulAdd, mulAdd, mulAdd, mulTranspose, mulTranspose, mulTranspose, mulTransposeAdd, mulTransposeAdd, mulTransposeAdd, oneNorm, rowSize, scan, set, set, setCCSValues, setCRSValues, setSize, toString, toString, trace, write, write, write
getThreeVectorValue
isWritable, scan, write
public Matrix3x3DiagBlock()
public Matrix3x3DiagBlock(double m00, double m11, double m22)
public void set(double m00, double m11, double m22)
public void set(int i, int j, double val)
Matrix3dBase
set
in interface DenseMatrix
set
in class Matrix3dBase
i
- element row indexj
- element column indexval
- element valuepublic boolean valueIsNonZero(int i, int j)
valueIsNonZero
in interface MatrixBlock
valueIsNonZero
in class Matrix3x3Block
i
- row indexj
- column indexpublic int numNonZeroVals()
numNonZeroVals
in interface Matrix
numNonZeroVals
in class MatrixBase
public int numNonZeroVals(Matrix.Partition part, int numRows, int numCols)
numRows
rows and the first numCols
columns.
If the matrix is dense and the partition is Full
,
then this will simply be the product of the number of rows times the
number of columns.numNonZeroVals
in interface Matrix
numNonZeroVals
in class MatrixBase
part
- matrix parition to be examinednumRows
- number of rows delimiting the sub-matrixnumCols
- number of columns delimiting the sub-matrixpublic void mulAdd(double[] y, int yIdx, double[] x, int xIdx)
x
, starting at location xIdx
, and
the result is added to values in y
, starting at location
yIdx
.mulAdd
in interface MatrixBlock
mulAdd
in class Matrix3x3Block
y
- accumulates resulting valuesyIdx
- starting index for accumulating valuesx
- supplies column vector valuesxIdx
- starting index for column vector valuespublic void mulTransposeAdd(double[] y, int yIdx, double[] x, int xIdx)
x
, starting at location xIdx
, and the
result is added to values in y
, starting at location
yIdx
.mulTransposeAdd
in interface MatrixBlock
mulTransposeAdd
in class Matrix3x3Block
y
- accumulates resulting valuesyIdx
- starting index for accumulating valuesx
- supplies row vector valuesxIdx
- starting index for row vector valuespublic int getBlockCRSIndices(int[] colIdxs, int colOff, int[] offsets, Matrix.Partition part)
colIdxs
, starting at a location given by
offsets[i]
. Indices are 0-based. Upon return,
offsets[i]
should be incremented by the number of non-zero
values in row i.getBlockCRSIndices
in interface MatrixBlock
getBlockCRSIndices
in class Matrix3x3Block
colIdxs
- stores column indices of non-zero entriescolOff
- starting column index for the first column of this blockoffsets
- offsets within colIdxs
for storing each row's indices; upon
return, should be incremented by the number of non-zero entries in each
row.part
- specifies whether to store column indices for the entire block or a
specified sub-portion.public void addNumNonZerosByRow(int[] offsets, int idx, Matrix.Partition part)
offsets
, starting
at the location specified by idx
.addNumNonZerosByRow
in interface MatrixBlock
addNumNonZerosByRow
in class Matrix3x3Block
offsets
- values to be incremented by the number of non-zero entries in each rowidx
- starting location within offsets
part
- specifies whether to consider the entire block or a specified sub-portion.public int getBlockCCSIndices(int[] rowIdxs, int rowOff, int[] offsets, Matrix.Partition part)
getBlockCCSIndices
in interface MatrixBlock
getBlockCCSIndices
in class Matrix3x3Block
rowIdxs
- stores row indices of non-zero entriesrowOff
- starting row index for the first row of this blockoffsets
- offsets within rowIdxs
for storing each column's indices;
upon return, should be incremented by the number of non-zero entries in
each column.part
- specifies whether to store row indices for the entire block or a specified
sub-portion.public void addNumNonZerosByCol(int[] offsets, int idx, Matrix.Partition part)
offsets
, starting
at the location specified by idx
.addNumNonZerosByCol
in interface MatrixBlock
addNumNonZerosByCol
in class Matrix3x3Block
offsets
- values to be incremented by the number of non-zero entries in each columnidx
- starting location within offsets
part
- specifies whether to consider the entire block or a specified sub-portion.public int getBlockCRSValues(double[] vals, int[] offsets, Matrix.Partition part)
vals
,
starting at a location given by offsets[i]
. Upon return,
offsets[i]
should be incremented by the number of non-zero
values in row i.getBlockCRSValues
in interface MatrixBlock
getBlockCRSValues
in class Matrix3x3Block
vals
- stores values of non-zero entriesoffsets
- offsets within vals
for storing each row's values; upon
return, should be incremented by the number of non-zero entries in each
row.part
- specifies whether to store the entire block or a specified sub-portion.public int getBlockCCSValues(double[] vals, int[] offsets, Matrix.Partition part)
vals
, starting at a location given by
offsets[j]
. Upon return, offsets[j]
should
be incremented by the number of non-zero values in column j.getBlockCCSValues
in interface MatrixBlock
getBlockCCSValues
in class Matrix3x3Block
vals
- stores values of non-zero entriesoffsets
- offsets within vals
for storing each columns's values; upon
return, should be incremented by the number of non-zero entries in each
column.part
- specifies whether to store the entire block or a specified sub-portion.