public class SparseBlockMatrix extends SparseMatrixBase implements Clonable
Modifier and Type | Class and Description |
---|---|
static class |
SparseBlockMatrix.PrintFormat |
Matrix.Partition, Matrix.WriteFormat
Modifier and Type | Field and Description |
---|---|
static int |
warningLevel |
INDEFINITE, POSITIVE_DEFINITE, SPD, SYMMETRIC
Constructor and Description |
---|
SparseBlockMatrix() |
SparseBlockMatrix(int[] rowColSizes) |
SparseBlockMatrix(int[] rowSizes,
int[] colSizes) |
Modifier and Type | Method and Description |
---|---|
void |
add(SparseBlockMatrix M) |
void |
add(SparseBlockMatrix M,
int numBlkRows,
int numBlkCols) |
MatrixBlock |
addBlock(int bi,
int bj,
Matrix M) |
int |
addBlock(int bi,
int bj,
MatrixBlock blk) |
void |
addCol(int size) |
void |
addCols(int[] sizes,
int num) |
void |
addNumNonZerosByCol(int[] offsets,
int idx,
Matrix.Partition part,
int numRows,
int numCols) |
void |
addNumNonZerosByRow(int[] offsets,
int idx,
Matrix.Partition part) |
void |
addNumNonZerosByRow(int[] offsets,
int firstRowIdx,
Matrix.Partition part,
int numRows,
int numCols) |
void |
addRow(int size) |
void |
addRows(int[] sizes,
int num) |
boolean |
blockStructureEquals(SparseBlockMatrix M1)
Returns true if the structure of this SparseBlockMatrix matches
that of another.
|
static SparseBlockMatrix |
buildKKTSystem(SparseBlockMatrix M,
SparseBlockMatrix GT) |
void |
checkConsistency()
Check that the internal structures of this matrix are consistent.
|
SparseBlockMatrix |
clone()
Creates a clone of this SparseBlockMatrix, along with clones of all the
associated MatrixBlocks.
|
int |
colSize()
Number of columns in the matrix associated with this transformation.
|
int |
colSize(int numBlkCols) |
SparseBlockMatrix |
createSubMatrix(int[] irows,
int[] icols) |
SparseBlockMatrix |
createSubMatrix(int numBlockRows,
int numBlockCols) |
static SparseBlockMatrix |
createTranspose(SparseBlockMatrix S) |
boolean |
elementIsNonZero(int i,
int j) |
MatrixBlock |
firstBlockInCol(int bj) |
MatrixBlock |
firstBlockInRow(int bi) |
double |
frobeniusNormSquared()
Returns the squared Frobenius norm of this matrix.
|
double |
get(int i,
int j)
Gets a single element of this matrix.
|
int |
getAlignedBlockCol(int j)
If a specified element column index is aligned with the beginning of a
block column, then this method returns the corresponding block column
index.
|
int |
getAlignedBlockRow(int i)
If a specified element row index is aligned with the beginning of a block
row, then this method returns the corresponding block row index.
|
MatrixBlock |
getBlock(int bi,
int bj) |
int |
getBlockCCSIndices(int[] rowIdxs,
int rowOff,
int[] offsets,
Matrix.Partition part) |
int |
getBlockCCSIndices(int[] rowIdxs,
int rowOff,
int[] offsets,
Matrix.Partition part,
int numRows,
int numCols) |
void |
getBlockCCSValues(double[] vals,
int[] offsets,
Matrix.Partition part) |
int |
getBlockCCSValues(double[] vals,
int[] offsets,
Matrix.Partition part,
int numRows,
int numCols) |
int |
getBlockCol(int j)
Returns the block column index corresponding to an element column index.
|
int |
getBlockColOffset(int bj) |
int |
getBlockColSize(int bj) |
int[] |
getBlockColSizes() |
int |
getBlockCRSIndices(int[] colIdxs,
int colOff,
int[] offsets,
Matrix.Partition part) |
int |
getBlockCRSIndices(int[] colIdxs,
int colOff,
int[] offsets,
Matrix.Partition part,
int numRows,
int numCols) |
int |
getBlockCRSValues(double[] vals,
int[] offsets,
Matrix.Partition part) |
int |
getBlockCRSValues(double[] vals,
int[] offsets,
Matrix.Partition part,
int numRows,
int numCols) |
java.lang.String |
getBlockPattern() |
java.lang.String |
getBlockPattern(int minRow,
int maxRow) |
int |
getBlockRow(int i)
Returns the block row index corresponding to an element row index.
|
int |
getBlockRowOffset(int bi) |
int |
getBlockRowSize(int bi) |
int[] |
getBlockRowSizes() |
int |
getCCSIndices(int[] rowIdxs,
int[] colOffs,
Matrix.Partition part,
int numRows,
int numCols)
Gets the compressed column storage (CCS) indices for a principal
sub-matrix of this matrix delimited by the first
numRows
rows and the first numCols columns. |
int |
getCCSValues(double[] vals,
Matrix.Partition part,
int numRows,
int numCols)
Gets the compressed column storage (CCS) values for a principal sub-matrix
of this matrix delimited by the first
numRows rows and the
first numCols columns. |
void |
getColumn(int j,
double[] values)
Copies a column of this matrix into an array of doubles.
|
void |
getColumn(int j,
double[] values,
int off,
int nrows) |
static int[] |
getComp(int[] idxs,
int size) |
int |
getCRSIndices(int[] colIdxs,
int[] rowOffs,
Matrix.Partition part,
int numRows,
int numCols)
Gets the compressed row storage (CRS) indices for a principal sub-matrix
of this matrix delimited by the first
numRows rows and the
first numCols columns. |
int |
getCRSValues(double[] vals,
Matrix.Partition part,
int numRows,
int numCols)
Gets the compressed row storage (CRS) values for a principal sub-matrix of
this matrix delimited by the first
numRows rows and the
first numCols columns. |
MatrixBlock |
getElementBlock(int i,
int j) |
static int[] |
getRange(int idx,
int numIdxs) |
void |
getRow(int i,
double[] values)
Copies a row of this matrix into an array of doubles.
|
void |
getRow(int i,
double[] values,
int off)
Copies a row of this matrix into an array of doubles, starting at a
specified offset.
|
SparseBlockSignature |
getSignature()
Returns a
SparseBlockSignature that uniquely describes the block
structure of this matrix. |
SparseBlockSignature |
getSignature(boolean vertical)
Returns a
SparseBlockSignature that uniquely describes the block
structure of this matrix. |
SparseBlockMatrix |
getSubMatrix(int bi,
int bj,
int numBlkRows,
int numBlkCols,
SparseBlockMatrix dest)
Ian TODO
|
int |
getSubMatrixColSize(int[] icols) |
void |
getSubMatrixColumn(int j,
double[] values,
int off,
int[] irows) |
void |
getSubMatrixRow(int i,
double[] values,
int off,
int[] icols) |
int |
getSubMatrixRowSize(int[] irows) |
boolean |
hasSymmetricBlockSizing() |
boolean |
isSymmetric(double tol)
Returns true if this matrix is symmetric within a given absolute
tolerance.
|
boolean |
isVerticallyLinked() |
double |
maxNorm()
Returns the max-norm of this matrix.
|
void |
mul(MatrixNd MR,
MatrixNd M1)
Computes the product
|
void |
mulLeft(MatrixNd MR,
MatrixNd M1)
Computes the product
|
void |
mulSubMatrixVec(double[] res,
double[] vec,
int[] irows,
int[] icols) |
void |
mulTransposeRight(MatrixNd MR,
MatrixNd M1)
Computes the product
|
void |
negate() |
int |
numBlockCols() |
int |
numBlockRows() |
int |
numBlocks() |
int |
numNonZeroVals()
Returns the number of non-zero values in this matrix object.
|
int |
numNonZeroVals(Matrix.Partition part) |
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 |
perturb(double tol) |
void |
printBlocks(java.io.PrintStream ps) |
void |
removeAllBlocks() |
void |
removeAllCols() |
void |
removeAllRows() |
MatrixBlock |
removeBlock(int bi,
int bj) |
boolean |
removeBlock(MatrixBlock oldBlk) |
void |
removeCol(int colIdx) |
void |
removeCols(int[] blkColIdxs) |
void |
removeRow(int rowIdx) |
void |
removeRows(int[] blkRowIdxs) |
int |
rowSize()
Number of rows in the matrix associated with this transformation.
|
int |
rowSize(int numBlkRows) |
void |
scale(double s) |
void |
scaledAdd(double s,
SparseBlockMatrix M) |
void |
scaledAdd(double s,
SparseBlockMatrix M,
int numBlkRows,
int numBlkCols) |
void |
scanBlocks(ReaderTokenizer rtok)
Sets the sizing and contents of the matrix to values read from
a ReaderTokenizer.
|
void |
set(double[] values,
int[] indices,
int nvals)
Sets the elements of this matrix from an array of doubles and a list of
indices.
|
void |
set(int i,
int j,
double val) |
void |
set(Matrix M)
Sets the size and values of this matrix to those of another matrix.
|
void |
set(SparseBlockMatrix M)
Sets this SparseBlockMatrix to a copy of another SparseBlockMatrix.
|
void |
setColCapacity(int newCap) |
void |
setRandomValues()
Sets the nonzero elements of this matrix to random values
in the range -0.5 (inclusive) to 0.5 (exclusive).
|
void |
setRandomValues(boolean symmetric)
Sets the nonzero elements of this matrix to random values
in the range -0.5 (inclusive) to 0.5 (exclusive).
|
void |
setRandomValues(double lower,
double upper,
java.util.Random generator,
boolean symmetric)
Sets the nonzero elements of this matrix to random values
in a specified range.
|
void |
setRowCapacity(int newCap) |
void |
setSubMatrix(SparseBlockMatrix M,
int[] irows,
int[] icols) |
void |
setVerticallyLinked(boolean enable) |
void |
setZero() |
boolean |
signatureEquals(SparseBlockSignature sig) |
void |
sub(SparseBlockMatrix M) |
void |
sub(SparseBlockMatrix M,
int numBlkRows,
int numBlkCols) |
java.lang.String |
toString(java.lang.String fmtStr,
int nrows,
int ncols) |
boolean |
valueIsNonZero(int i,
int j) |
void |
writeBlocks(java.io.PrintWriter pw) |
void |
writeBlocks(java.io.PrintWriter pw,
NumberFormat fmt)
Writes the contents of this matrix to a PrintWriter, using a sparse
block structure.
|
void |
zeroColumn(int j) |
void |
zeroRow(int i) |
setCCSValues, setCRSValues, setRandom, setRandom, writeToFileCRS
containsNaN, determinant, epsilonEquals, equals, frobeniusNorm, get, get, getCCSIndices, getCCSIndices, getCCSValues, getCCSValues, getColumn, getColumn, getCRSIndices, getCRSIndices, getCRSValues, getCRSValues, getDefaultFormat, getRow, getSize, getSubMatrix, hasNaN, idString, infinityNorm, isFixedSize, isWritable, mul, mul, mul, mulAdd, mulAdd, mulAdd, mulTranspose, mulTranspose, mulTranspose, mulTransposeAdd, mulTransposeAdd, mulTransposeAdd, oneNorm, scan, scan, setCRSValues, setDefaultFormat, setSize, toString, toString, toString, trace, write, write, write, write, write, write, write, writeToFile
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
determinant, epsilonEquals, equals, frobeniusNorm, get, getCCSIndices, getCCSIndices, getCCSValues, getCCSValues, getColumn, getColumn, getCRSIndices, getCRSIndices, getCRSValues, getCRSValues, getRow, getSize, getSubMatrix, infinityNorm, isFixedSize, mul, mul, mul, mulAdd, mulAdd, mulAdd, mulTranspose, mulTranspose, mulTranspose, mulTransposeAdd, mulTransposeAdd, mulTransposeAdd, oneNorm, scan, setSize, toString, toString, trace, write, write, write
public SparseBlockMatrix()
public SparseBlockMatrix(int[] rowColSizes)
public SparseBlockMatrix(int[] rowSizes, int[] colSizes)
public void setRowCapacity(int newCap)
public void addRow(int size)
public void addRows(int[] sizes, int num)
public void removeRow(int rowIdx)
public void setColCapacity(int newCap)
public void addCol(int size)
public void addCols(int[] sizes, int num)
public void removeCol(int colIdx)
public void removeCols(int[] blkColIdxs)
public void removeRows(int[] blkRowIdxs)
public void removeAllCols()
public void removeAllRows()
public int getBlockRowOffset(int bi)
public int getBlockRowSize(int bi)
public int[] getBlockRowSizes()
public int getBlockColOffset(int bj)
public int getBlockColSize(int bj)
public int[] getBlockColSizes()
public int numBlocks()
public int addBlock(int bi, int bj, MatrixBlock blk)
public MatrixBlock addBlock(int bi, int bj, Matrix M)
public boolean removeBlock(MatrixBlock oldBlk)
public MatrixBlock removeBlock(int bi, int bj)
public void removeAllBlocks()
public MatrixBlock getBlock(int bi, int bj)
public MatrixBlock firstBlockInRow(int bi)
public MatrixBlock firstBlockInCol(int bj)
public int rowSize()
MatrixBase
mul
.rowSize
in interface LinearTransformNd
rowSize
in interface Matrix
rowSize
in class MatrixBase
public int rowSize(int numBlkRows)
public int numBlockRows()
public int numBlockCols()
public int colSize(int numBlkCols)
public int colSize()
MatrixBase
mul
.colSize
in interface LinearTransformNd
colSize
in interface Matrix
colSize
in class MatrixBase
public boolean elementIsNonZero(int i, int j)
public boolean valueIsNonZero(int i, int j)
public MatrixBlock getElementBlock(int i, int j)
public double get(int i, int j)
MatrixBase
get
in interface Matrix
get
in class MatrixBase
i
- element row indexj
- element column indexpublic void set(int i, int j, double val)
public void set(double[] values, int[] indices, int nvals)
Matrix
indices[k*2]
and
indices[k*2+1]
, respectively. All non-specified elements
are set to zero.public int numNonZeroVals()
MatrixBase
numNonZeroVals
in interface Matrix
numNonZeroVals
in class MatrixBase
public int numNonZeroVals(Matrix.Partition part)
public int numNonZeroVals(Matrix.Partition part, int numRows, int numCols)
MatrixBase
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 setZero()
public void scale(double s)
scale
in interface SparseMatrix
public void negate()
public void mul(MatrixNd MR, MatrixNd M1)
MR = MS M1where
MS
is this matrix, and stores the result in MR
,
which is sized appropriately. If MR == M1
and the required
size of MR
does not equal that of M1
, then an internal
copy of M1
is made for computational purposes and M1
is resized as required.public void mulLeft(MatrixNd MR, MatrixNd M1)
MR = M1 MSwhere
MS
is this matrix, and stores the result in MR
,
which is sized appropriately. If MR == M1
and the required
size of MR
does not equal that of M1
, then an internal
copy of M1
is made for computational purposes and M1
is resized as required.public void mulTransposeRight(MatrixNd MR, MatrixNd M1)
MR = MS M1^There
MS
is this matrix, and stores the result in MR
,
which will be sized appropriately. If MR == M1
, then an internal
copy will be made of M1
for computational purposes
and M1
will be resized as needed to store the result.public int getBlockRow(int i)
i
- element row indexpublic int getBlockCol(int j)
j
- element column indexpublic int getAlignedBlockRow(int i)
i
- element row indexpublic SparseBlockMatrix getSubMatrix(int bi, int bj, int numBlkRows, int numBlkCols, SparseBlockMatrix dest)
public int getAlignedBlockCol(int j)
j
- element column indexpublic int getCRSIndices(int[] colIdxs, int[] rowOffs, Matrix.Partition part, int numRows, int numCols)
numRows
rows and the
first numCols
columns. The sub-matrix must be
block-aligned. Indices are 0-based and the sub-matrix is traversed in
row-major order.getCRSIndices
in interface Matrix
getCRSIndices
in class MatrixBase
colIdxs
- returns the column indices of each non-zero element. This array must have
a length equal at least to the number of non-zero elements in the
sub-matrix.rowOffs
- returns the offsets into colIdxs
corresponding to the first
non-zero element in each row. This array must have a length equal at least
to the number of rows in the sub-matrix.part
- specifies what portion of the sub-matrix to store; must be either
Full
or
UpperTriangular
numRows
- number of rows delimiting the sub-matrixnumCols
- number of columns delimiting the sub-matrixpublic int getCRSValues(double[] vals, Matrix.Partition part, int numRows, int numCols)
numRows
rows and the
first numCols
columns. The sub-matrix must be
block-aligned, and it is traversed in row-major order.getCRSValues
in interface Matrix
getCRSValues
in class MatrixBase
vals
- returns the value of each non-zero element. This array must have a length
equal at least to the number of non-zero elements in the sub-matrix.part
- specifies what portion of the sub-matrix to store; must be either
Full
or
UpperTriangular
numRows
- number of rows delimiting the sub-matrixnumCols
- number of columns delimiting the sub-matrixpublic int getBlockCRSIndices(int[] colIdxs, int colOff, int[] offsets, Matrix.Partition part)
public int getBlockCRSIndices(int[] colIdxs, int colOff, int[] offsets, Matrix.Partition part, int numRows, int numCols)
public int getBlockCRSValues(double[] vals, int[] offsets, Matrix.Partition part)
public int getBlockCRSValues(double[] vals, int[] offsets, Matrix.Partition part, int numRows, int numCols)
public void addNumNonZerosByRow(int[] offsets, int idx, Matrix.Partition part)
public void addNumNonZerosByRow(int[] offsets, int firstRowIdx, Matrix.Partition part, int numRows, int numCols)
public int getCCSIndices(int[] rowIdxs, int[] colOffs, Matrix.Partition part, int numRows, int numCols)
numRows
rows and the first numCols
columns. The sub-matrix must be
block-aligned. Indices are 0-based and the sub-matrix is traversed in
column-major order.getCCSIndices
in interface Matrix
getCCSIndices
in class MatrixBase
rowIdxs
- returns the row indices of each non-zero element. This array must have a
length equal at least to the number of non-zero elements in the
sub-matrix.colOffs
- returns the offsets into rowIdxs
corresponding to the first
non-zero element in each column. This array must have a length equal at
least to the number of columns in the sub-matrix.part
- specifies what portion of the sub-matrix to store; must be either
Full
or
LowerTriangular
numRows
- number of rows delimiting the sub-matrixnumCols
- number of columns delimiting the sub-matrixpublic int getCCSValues(double[] vals, Matrix.Partition part, int numRows, int numCols)
numRows
rows and the
first numCols
columns. The sub-matrix must be block aligned
and it is traversed in column-major order.getCCSValues
in interface Matrix
getCCSValues
in class MatrixBase
vals
- returns the value of each non-zero element. This array must have a length
equal at least to the number of non-zero elements in the sub-matrix.part
- specifies what portion of the sub-matrix to store; must be either
Full
or
LowerTriangular
numRows
- number of rows delimiting the sub-matrixnumCols
- number of columns delimiting the sub-matrixpublic int getBlockCCSIndices(int[] rowIdxs, int rowOff, int[] offsets, Matrix.Partition part)
public int getBlockCCSIndices(int[] rowIdxs, int rowOff, int[] offsets, Matrix.Partition part, int numRows, int numCols)
public void getBlockCCSValues(double[] vals, int[] offsets, Matrix.Partition part)
public int getBlockCCSValues(double[] vals, int[] offsets, Matrix.Partition part, int numRows, int numCols)
public void addNumNonZerosByCol(int[] offsets, int idx, Matrix.Partition part, int numRows, int numCols)
public void add(SparseBlockMatrix M)
public void add(SparseBlockMatrix M, int numBlkRows, int numBlkCols)
public void sub(SparseBlockMatrix M)
public void sub(SparseBlockMatrix M, int numBlkRows, int numBlkCols)
public void scaledAdd(double s, SparseBlockMatrix M)
public void scaledAdd(double s, SparseBlockMatrix M, int numBlkRows, int numBlkCols)
public java.lang.String toString(java.lang.String fmtStr, int nrows, int ncols)
public java.lang.String getBlockPattern()
public java.lang.String getBlockPattern(int minRow, int maxRow)
public void printBlocks(java.io.PrintStream ps)
public void setRandomValues()
public void setRandomValues(boolean symmetric)
symmetric
- if true, sets transposed values to the same value
(ignored if the matrix is not square or does not have identical
row and block sizes).public void setRandomValues(double lower, double upper, java.util.Random generator, boolean symmetric)
lower
- lower random value (inclusive)upper
- upper random value (exclusive)generator
- random number generatorsymmetric
- if true, sets transposed values to the same value
(ignored if the matrix is not square or does not have identical
row and block sizes).public void set(Matrix M)
SparseMatrixBase
set
in interface Matrix
set
in class SparseMatrixBase
M
- matrix whose size and values are copiedpublic void set(SparseBlockMatrix M)
M
- matrix to be copiedpublic SparseBlockMatrix clone()
public void getRow(int i, double[] values)
MatrixBase
getRow
in interface Matrix
getRow
in class MatrixBase
i
- row indexvalues
- array into which the row is copiedpublic void getRow(int i, double[] values, int off)
MatrixBase
getRow
in interface Matrix
getRow
in class MatrixBase
i
- row indexvalues
- array into which the row is copiedoff
- offset in values where copying should beginpublic void zeroRow(int i)
public void getColumn(int j, double[] values)
MatrixBase
getColumn
in interface Matrix
getColumn
in class MatrixBase
j
- column indexvalues
- array into which the column is copiedpublic void getColumn(int j, double[] values, int off, int nrows)
public void zeroColumn(int j)
public void checkConsistency()
checkConsistency
in interface Matrix
public void perturb(double tol)
public void setVerticallyLinked(boolean enable)
public boolean isVerticallyLinked()
public static SparseBlockMatrix buildKKTSystem(SparseBlockMatrix M, SparseBlockMatrix GT)
public SparseBlockMatrix createSubMatrix(int numBlockRows, int numBlockCols)
public SparseBlockMatrix createSubMatrix(int[] irows, int[] icols)
public void setSubMatrix(SparseBlockMatrix M, int[] irows, int[] icols)
public void getSubMatrixRow(int i, double[] values, int off, int[] icols)
public void getSubMatrixColumn(int j, double[] values, int off, int[] irows)
public void mulSubMatrixVec(double[] res, double[] vec, int[] irows, int[] icols)
public int getSubMatrixRowSize(int[] irows)
public int getSubMatrixColSize(int[] icols)
public static int[] getRange(int idx, int numIdxs)
public static int[] getComp(int[] idxs, int size)
public void writeBlocks(java.io.PrintWriter pw) throws java.io.IOException
java.io.IOException
public void writeBlocks(java.io.PrintWriter pw, NumberFormat fmt) throws java.io.IOException
[ ]
. The opening bracket
is then followed by two integer vectors, each contained within
square brackets, giving the number of rows in each block row and
the number of columns in each block column. This is then followed
by the blocks, presented in row-major order, with each
individual block written using the format
[ bi bj nr nc xx xx xx xx xx xx xx xx xx ]where
bi
and bj
give the block row and column
indices, nr
and nc
give the number
of rows and columns in the block, and xx
denotes the
individual numeric values in dense format. The latter are
formatted using a C printf
style as
described by the parameter NumberFormat
.pw
- PrintWriter to write this matrix tofmt
- numeric formatjava.io.IOException
public void scanBlocks(ReaderTokenizer rtok) throws java.io.IOException
writeBlocks
.rtok
- ReaderTokenizer from which values are read.java.io.IOException
public SparseBlockSignature getSignature()
SparseBlockSignature
that uniquely describes the block
structure of this matrix. The functionality is the same as getSignature(boolean)
, with vertical
used if
the matrix is vertically linked and the number of blocks
exceeds the number of block columns.public SparseBlockSignature getSignature(boolean vertical)
SparseBlockSignature
that uniquely describes the block
structure of this matrix. The signature contains the block row and column
sizes of the matrix, whether the signature is horizontal or vertical (see
below), plus a data array with the following additional information:
* row offset for each block row, plus total number of rows * column offset for each block column, plus total number of columns * for each block row (or column): the number of blocks in the row (or column), followed by the column (or row) index of each block
A horizontal signature lists the block column indices of each block in row major order, with -1 indicating the start of each block row.
A vertical signature lists the block row indices of each block in column major order, with -1 indicating the start of each block column.
A vertical signature is used if vertical
is true
. A
vertical signature will also cause the matrix to be vertically linked, if
it is not already.
Note that horizontal and vertical signatures will not match, even if the block structure of the matrix is the same.
vertical
- if true
, returns apublic boolean signatureEquals(SparseBlockSignature sig)
public boolean blockStructureEquals(SparseBlockMatrix M1)
M1
- matrix to compare withpublic double frobeniusNormSquared()
frobeniusNormSquared
in interface Matrix
frobeniusNormSquared
in class MatrixBase
public double maxNorm()
Matrix
maxNorm
in interface Matrix
maxNorm
in class MatrixBase
public boolean isSymmetric(double tol)
MatrixBase
isSymmetric
in interface Matrix
isSymmetric
in class MatrixBase
tol
- absolute tolerance for checking equality of off-diagonal elementspublic boolean hasSymmetricBlockSizing()
public static SparseBlockMatrix createTranspose(SparseBlockMatrix S)