Package org.ujmp.core.doublematrix.impl
Class BlockMatrixLayout
- java.lang.Object
-
- org.ujmp.core.doublematrix.impl.BlockMatrixLayout
-
- All Implemented Interfaces:
java.io.Serializable
public final class BlockMatrixLayout extends java.lang.Object implements java.io.Serializable
This class describes the layout (size, order) of a square block of data within ablock matrix
.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
BlockMatrixLayout.BlockOrder
Enum describing the layout of a block of data.
-
Field Summary
Fields Modifier and Type Field Description protected int
blockArea
Total size of a block (area).BlockMatrixLayout.BlockOrder
blockOrder
Whether this block is laid out in row-major (true) or column-major (false) order.int
blockStripe
Length of one side (stripe) of a square block.int
columns
Number of columns of matrix.(package private) int
numberOfBlocks
number of blocks in this matrixprivate boolean
rowMajor
int
rows
Number of rows of matrix.private static long
serialVersionUID
private int
sqbColThreshold
threshold for when to stop using square blocks.private int
sqbRowThreshold
threshold for when to stop using square blocks.
-
Constructor Summary
Constructors Constructor Description BlockMatrixLayout(int rows, int columns, int blockStripe, BlockMatrixLayout.BlockOrder blockOrder)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) double[]
getBlock(BlockDenseDoubleMatrix2D matrix, int row, int column)
Get the block which contains the specified row, column(package private) int
getBlockIndexByColumn(int lrow, int lcol, int numRows, int numCols)
(package private) int
getBlockIndexByRow(int lrow, int lcol, int numRows, int numCols)
(package private) int
getBlockNumber(int row, int col)
(package private) int
getBlockSize(int row, int col)
(package private) int
getColumnsInBlock(int col)
(package private) int
getIndexInBlock(int row, int col)
(package private) int
getRowsInBlock(int row)
(package private) double[]
toColMajorBlock(double[] block, int rowStart, int colStart)
(package private) double[]
toColMajorBlock(BlockDenseDoubleMatrix2D matrix, int rowStart, int colStart)
(package private) double[]
toRowMajorBlock(double[] block, int rowStart, int colStart)
(package private) double[]
toRowMajorBlock(BlockDenseDoubleMatrix2D matrix, int rowStart, int colStart)
java.lang.String
toString()
-
-
-
Field Detail
-
serialVersionUID
private static final long serialVersionUID
- See Also:
- Constant Field Values
-
blockArea
protected final int blockArea
Total size of a block (area).
-
blockStripe
public final int blockStripe
Length of one side (stripe) of a square block.
-
columns
public final int columns
Number of columns of matrix.
-
blockOrder
public final BlockMatrixLayout.BlockOrder blockOrder
Whether this block is laid out in row-major (true) or column-major (false) order.
-
numberOfBlocks
final int numberOfBlocks
number of blocks in this matrix
-
rowMajor
private final boolean rowMajor
- See Also:
blockOrder
-
rows
public final int rows
Number of rows of matrix.
-
sqbColThreshold
private final int sqbColThreshold
threshold for when to stop using square blocks.
-
sqbRowThreshold
private final int sqbRowThreshold
threshold for when to stop using square blocks.
-
-
Constructor Detail
-
BlockMatrixLayout
BlockMatrixLayout(int rows, int columns, int blockStripe, BlockMatrixLayout.BlockOrder blockOrder)
-
-
Method Detail
-
getBlock
final double[] getBlock(BlockDenseDoubleMatrix2D matrix, int row, int column)
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
final double[] toColMajorBlock(BlockDenseDoubleMatrix2D matrix, int rowStart, int colStart)
-
toColMajorBlock
final double[] toColMajorBlock(double[] block, int rowStart, int colStart)
-
getColumnsInBlock
int getColumnsInBlock(int col)
-
getRowsInBlock
int getRowsInBlock(int row)
-
toRowMajorBlock
final double[] toRowMajorBlock(BlockDenseDoubleMatrix2D matrix, int rowStart, int colStart)
-
toRowMajorBlock
final double[] toRowMajorBlock(double[] block, int rowStart, int colStart)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-