Package org.ujmp.core.doublematrix.impl
Class BlockMatrixLayout
java.lang.Object
org.ujmp.core.doublematrix.impl.BlockMatrixLayout
- All Implemented Interfaces:
Serializable
This class describes the layout (size, order) of a square block of data
within a
block matrix
.- See Also:
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Enum describing the layout of a block of data. -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final int
Total size of a block (area).Whether this block is laid out in row-major (true) or column-major (false) order.final int
Length of one side (stripe) of a square block.final int
Number of columns of matrix.(package private) final int
number of blocks in this matrixprivate final boolean
final int
Number of rows of matrix.private static final long
private final int
threshold for when to stop using square blocks.private final int
threshold for when to stop using square blocks. -
Constructor Summary
ConstructorsConstructorDescriptionBlockMatrixLayout
(int rows, int columns, int blockStripe, BlockMatrixLayout.BlockOrder blockOrder) -
Method Summary
Modifier and TypeMethodDescription(package private) final double[]
getBlock
(BlockDenseDoubleMatrix2D matrix, int row, int column) Get the block which contains the specified row, column(package private) final int
getBlockIndexByColumn
(int lrow, int lcol, int numRows, int numCols) (package private) final int
getBlockIndexByRow
(int lrow, int lcol, int numRows, int numCols) (package private) final int
getBlockNumber
(int row, int col) (package private) final int
getBlockSize
(int row, int col) (package private) int
getColumnsInBlock
(int col) (package private) final int
getIndexInBlock
(int row, int col) (package private) int
getRowsInBlock
(int row) (package private) final double[]
toColMajorBlock
(double[] block, int rowStart, int colStart) (package private) final double[]
toColMajorBlock
(BlockDenseDoubleMatrix2D matrix, int rowStart, int colStart) (package private) final double[]
toRowMajorBlock
(double[] block, int rowStart, int colStart) (package private) final double[]
toRowMajorBlock
(BlockDenseDoubleMatrix2D matrix, int rowStart, int colStart) toString()
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
blockArea
protected final int blockAreaTotal size of a block (area). -
blockStripe
public final int blockStripeLength of one side (stripe) of a square block. -
columns
public final int columnsNumber of columns of matrix. -
blockOrder
Whether this block is laid out in row-major (true) or column-major (false) order. -
numberOfBlocks
final int numberOfBlocksnumber of blocks in this matrix -
rowMajor
private final boolean rowMajor- See Also:
-
rows
public final int rowsNumber of rows of matrix. -
sqbColThreshold
private final int sqbColThresholdthreshold for when to stop using square blocks. -
sqbRowThreshold
private final int sqbRowThresholdthreshold for when to stop using square blocks.
-
-
Constructor Details
-
BlockMatrixLayout
BlockMatrixLayout(int rows, int columns, int blockStripe, BlockMatrixLayout.BlockOrder blockOrder)
-
-
Method Details
-
getBlock
Get the block which contains the specified row, column- Parameters:
matrix
- to get block fromrow
-column
-- Returns:
- block containing given row, column
-
getBlockIndexByColumn
final int getBlockIndexByColumn(int lrow, int lcol, int numRows, int numCols) -
getBlockIndexByRow
final int getBlockIndexByRow(int lrow, int lcol, int numRows, int numCols) -
getBlockNumber
final int getBlockNumber(int row, int col) -
getIndexInBlock
final int getIndexInBlock(int row, int col) -
getBlockSize
final int getBlockSize(int row, int col) -
toColMajorBlock
-
toColMajorBlock
final double[] toColMajorBlock(double[] block, int rowStart, int colStart) -
getColumnsInBlock
int getColumnsInBlock(int col) -
getRowsInBlock
int getRowsInBlock(int row) -
toRowMajorBlock
-
toRowMajorBlock
final double[] toRowMajorBlock(double[] block, int rowStart, int colStart) -
toString
-