# Uses of Class
org.apache.sysds.runtime.data.SparseBlock

Packages that use SparseBlock
Package
Description
org.apache.sysds.runtime.compress
org.apache.sysds.runtime.compress.colgroup
org.apache.sysds.runtime.compress.colgroup.dictionary
org.apache.sysds.runtime.compress.colgroup.indexes
org.apache.sysds.runtime.compress.colgroup.mapping
org.apache.sysds.runtime.compress.colgroup.offset
org.apache.sysds.runtime.controlprogram.caching
org.apache.sysds.runtime.data
org.apache.sysds.runtime.io
org.apache.sysds.runtime.matrix.data
org.apache.sysds.runtime.util

## Uses of SparseBlock in org.apache.sysds.runtime.compress

Methods in org.apache.sysds.runtime.compress that return SparseBlock
Modifier and Type
Method
Description
`SparseBlock`
CompressedMatrixBlock.`getSparseBlock()`
Methods in org.apache.sysds.runtime.compress with parameters of type SparseBlock
Modifier and Type
Method
Description
`void`
CompressedMatrixBlock.`appendRowToSparse(SparseBlock dest, MatrixBlock src, int i, int rowoffset, int coloffset, boolean deep)`
`void`
CompressedMatrixBlock.`setSparseBlock(SparseBlock sblock)`

## Uses of SparseBlock in org.apache.sysds.runtime.compress.colgroup

Methods in org.apache.sysds.runtime.compress.colgroup with parameters of type SparseBlock
Modifier and Type
Method
Description
`final void`
AColGroup.`decompressToSparseBlock(SparseBlock sb, int rl, int ru)`
Decompress a range of rows into a sparse block Note that this is using append, so the sparse column indexes need to be sorted afterwards.
`abstract void`
AColGroup.`decompressToSparseBlock(SparseBlock sb, int rl, int ru, int offR, int offC)`
Decompress into the SparseBlock.
`final void`
ADictBasedColGroup.`decompressToSparseBlock(SparseBlock sb, int rl, int ru, int offR, int offC)`
`void`
ASDCZero.`decompressToSparseBlock(SparseBlock sb, int rl, int ru, int offR, int offC, AIterator it)`
`void`
ColGroupEmpty.`decompressToSparseBlock(SparseBlock sb, int rl, int ru, int offR, int offC)`
`void`
ColGroupLinearFunctional.`decompressToSparseBlock(SparseBlock ret, int rl, int ru, int offR, int offC)`
`void`
ColGroupUncompressed.`decompressToSparseBlock(SparseBlock ret, int rl, int ru, int offR, int offC)`
`void`
ColGroupUncompressedArray.`decompressToSparseBlock(SparseBlock sb, int rl, int ru, int offR, int offC)`
`abstract void`
ASDCZero.`decompressToSparseBlockDenseDictionaryWithProvidedIterator(SparseBlock db, int rl, int ru, int offR, int offC, double[] values, AIterator it)`
`void`
ColGroupSDCSingleZeros.`decompressToSparseBlockDenseDictionaryWithProvidedIterator(SparseBlock ret, int rl, int ru, int offR, int offC, double[] values, AIterator it)`
`void`
ColGroupSDCZeros.`decompressToSparseBlockDenseDictionaryWithProvidedIterator(SparseBlock ret, int rl, int ru, int offR, int offC, double[] values, AIterator it)`
`static ColGroupUtils.P[]`
ColGroupUtils.`getSortedSelection(SparseBlock sb, int rl, int ru)`
Get a list of points locations from the SparseBlock.
`static void`
ColGroupUtils.`outerProduct(double[] leftRowSum, SparseBlock rightColSum, IColIndex colIdxRight, double[] result, int nColR, int rl, int ru)`
`abstract void`
APreAgg.`preAggregateSparse(SparseBlock sb, double[] preAgg, int rl, int ru, int cl, int cu)`
`void`
ColGroupDDC.`preAggregateSparse(SparseBlock sb, double[] preAgg, int rl, int ru, int cl, int cu)`
`void`
ColGroupDDCLZW.`preAggregateSparse(SparseBlock sb, double[] preAgg, int rl, int ru, int cl, int cu)`
`void`
ColGroupDeltaDDC.`preAggregateSparse(SparseBlock sb, double[] preAgg, int rl, int ru, int cl, int cu)`
`void`
ColGroupOLE.`preAggregateSparse(SparseBlock sb, double[] preAgg, int rl, int ru, int cl, int cu)`
`void`
ColGroupRLE.`preAggregateSparse(SparseBlock sb, double[] preAgg, int rl, int ru, int cl, int cu)`
`void`
ColGroupSDCSingleZeros.`preAggregateSparse(SparseBlock sb, double[] preAgg, int rl, int ru, int cl, int cu)`
`void`
ColGroupSDCZeros.`preAggregateSparse(SparseBlock sb, double[] preAgg, int rl, int ru, int cl, int cu)`

## Uses of SparseBlock in org.apache.sysds.runtime.compress.colgroup.dictionary

Methods in org.apache.sysds.runtime.compress.colgroup.dictionary with parameters of type SparseBlock
Modifier and Type
Method
Description
`void`
ADictionary.`MMDictScalingSparse(SparseBlock left, IColIndex rowsLeft, IColIndex colsRight, MatrixBlock result, int[] scaling)`
`void`
Dictionary.`MMDictScalingSparse(SparseBlock left, IColIndex rowsLeft, IColIndex colsRight, MatrixBlock result, int[] scaling)`
`void`
IDictionary.`MMDictScalingSparse(SparseBlock left, IColIndex rowsLeft, IColIndex colsRight, MatrixBlock result, int[] scaling)`
Matrix multiplication of dictionaries left side sparse and transposed right side is this.
`void`
MatrixBlockDictionary.`MMDictScalingSparse(SparseBlock left, IColIndex rowsLeft, IColIndex colsRight, MatrixBlock result, int[] scaling)`
`void`
ADictionary.`MMDictSparse(SparseBlock left, IColIndex rowsLeft, IColIndex colsRight, MatrixBlock result)`
`void`
Dictionary.`MMDictSparse(SparseBlock left, IColIndex rowsLeft, IColIndex colsRight, MatrixBlock result)`
`void`
IDictionary.`MMDictSparse(SparseBlock left, IColIndex rowsLeft, IColIndex colsRight, MatrixBlock result)`
Matrix multiplication of dictionaries left side sparse and transposed right side is this.
`void`
MatrixBlockDictionary.`MMDictSparse(SparseBlock left, IColIndex rowsLeft, IColIndex colsRight, MatrixBlock result)`
`void`
ADictionary.`putSparse(SparseBlock sb, int idx, int rowOut, int nCol, IColIndex columns)`
`void`
IDictionary.`putSparse(SparseBlock sb, int idx, int rowOut, int nCol, IColIndex columns)`
Put the row specified into the sparse block, via append calls.
`IDictionary`
ADictionary.`rightMMPreAggSparse(int numVals, SparseBlock b, IColIndex thisCols, IColIndex aggregateColumns, int nColRight)`
`IDictionary`
IDictionary.`rightMMPreAggSparse(int numVals, SparseBlock b, IColIndex thisCols, IColIndex aggregateColumns, int nColRight)`
Pre-aggregate the given sparse block for right multiplication.
`void`
ADictionary.`TSMMToUpperTriangleSparse(SparseBlock left, IColIndex rowsLeft, IColIndex colsRight, MatrixBlock result)`
`void`
Dictionary.`TSMMToUpperTriangleSparse(SparseBlock left, IColIndex rowsLeft, IColIndex colsRight, MatrixBlock result)`
`void`
IDictionary.`TSMMToUpperTriangleSparse(SparseBlock left, IColIndex rowsLeft, IColIndex colsRight, MatrixBlock result)`
Matrix multiplication but allocate output in upper triangle and twice if on diagonal, note this is right
`void`
MatrixBlockDictionary.`TSMMToUpperTriangleSparse(SparseBlock left, IColIndex rowsLeft, IColIndex colsRight, MatrixBlock result)`
`void`
ADictionary.`TSMMToUpperTriangleSparseScaling(SparseBlock left, IColIndex rowsLeft, IColIndex colsRight, int[] scale, MatrixBlock result)`
`void`
Dictionary.`TSMMToUpperTriangleSparseScaling(SparseBlock left, IColIndex rowsLeft, IColIndex colsRight, int[] scale, MatrixBlock result)`
`void`
IDictionary.`TSMMToUpperTriangleSparseScaling(SparseBlock left, IColIndex rowsLeft, IColIndex colsRight, int[] scale, MatrixBlock result)`
Matrix multiplication but allocate output in upper triangle and twice if on diagonal, note this is right
`void`
MatrixBlockDictionary.`TSMMToUpperTriangleSparseScaling(SparseBlock left, IColIndex rowsLeft, IColIndex colsRight, int[] scale, MatrixBlock result)`

## Uses of SparseBlock in org.apache.sysds.runtime.compress.colgroup.indexes

Methods in org.apache.sysds.runtime.compress.colgroup.indexes with parameters of type SparseBlock
Modifier and Type
Method
Description
`void`
AColIndex.`decompressToDenseFromSparse(SparseBlock sb, int vr, int off, double[] c)`
`void`
IColIndex.`decompressToDenseFromSparse(SparseBlock sb, int vr, int off, double[] c)`
Decompress this column index into the dense c array.

## Uses of SparseBlock in org.apache.sysds.runtime.compress.colgroup.mapping

Methods in org.apache.sysds.runtime.compress.colgroup.mapping with parameters of type SparseBlock
Modifier and Type
Method
Description
`void`
AMapToData.`lmSparseMatrixRow(SparseBlock sb, int r, DenseBlock db, IColIndex colIndexes, IDictionary dict)`
`void`
MapToByte.`lmSparseMatrixRow(SparseBlock sb, int r, DenseBlock db, IColIndex colIndexes, IDictionary dict)`
`void`
MapToChar.`lmSparseMatrixRow(SparseBlock sb, int r, DenseBlock db, IColIndex colIndexes, IDictionary dict)`
`void`
MapToCharPByte.`lmSparseMatrixRow(SparseBlock sb, int r, DenseBlock db, IColIndex colIndexes, IDictionary dict)`
`final void`
AMapToData.`preAggregateSparse(SparseBlock sb, double[] preAV, int rl, int ru)`
PreAggregate the sparseblock in the range of rows given.
`final void`
AMapToData.`preAggregateSparse(SparseBlock sb, double[] preAV, int rl, int ru, AOffset indexes)`
PreAggregate the SparseBlock in the range of rows given.

## Uses of SparseBlock in org.apache.sysds.runtime.compress.colgroup.offset

Methods in org.apache.sysds.runtime.compress.colgroup.offset with parameters of type SparseBlock
Modifier and Type
Method
Description
`final void`
AOffset.`preAggSparseMap(SparseBlock sb, double[] preAV, int rl, int ru, int nVal, AMapToData data)`

## Uses of SparseBlock in org.apache.sysds.runtime.controlprogram.caching

Methods in org.apache.sysds.runtime.controlprogram.caching with parameters of type SparseBlock
Modifier and Type
Method
Description
`long`
CacheDataInput.`readSparseRows(int rlen, long nnz, SparseBlock rows)`
`void`
CacheDataOutput.`writeSparseRows(int rlen, SparseBlock rows)`

## Uses of SparseBlock in org.apache.sysds.runtime.data

Subclasses of SparseBlock in org.apache.sysds.runtime.data
Modifier and Type
Class
Description
`class`
`SparseBlockCOO`
SparseBlock implementation that realizes a traditional 'coordinate matrix' representation, where the entire sparse block is stored as triples in three arrays: row indexes, column indexes, and values, where row indexes and colunm indexes are sorted in order to allow binary search.
`class`
`SparseBlockCSC`
SparseBlock implementation that realizes a traditional 'compressed sparse column' representation, where the entire sparse block is stored as three arrays: ptr of length clen+1 to store offsets per column, and indexes/values of length nnz to store row indexes and values of non-zero entries.
`class`
`SparseBlockCSR`
SparseBlock implementation that realizes a traditional 'compressed sparse row' representation, where the entire sparse block is stored as three arrays: ptr of length rlen+1 to store offsets per row, and indexes/values of length nnz to store column indexes and values of non-zero entries.
`class`
`SparseBlockDCSR`
`class`
`SparseBlockMCSC`
SparseBlock implementation that realizes a 'modified compressed sparse column' representation, where each compressed column is stored as a separate SparseRow object which provides flexibility for unsorted column appends without the need for global reshifting of values/indexes but it incurs additional memory overhead per column for object/array headers per column which also slows down memory-bound operations due to higher memory bandwidth requirements.
`class`
`SparseBlockMCSR`
SparseBlock implementation that realizes a 'modified compressed sparse row' representation, where each compressed row is stored as a separate SparseRow object which provides flexibility for unsorted row appends without the need for global reshifting of values/indexes but it incurs additional memory overhead per row for object/array headers per row which also slows down memory-bound operations due to higher memory bandwidth requirements.
Methods in org.apache.sysds.runtime.data that return SparseBlock
Modifier and Type
Method
Description
`static SparseBlock`
SparseBlockFactory.`copySparseBlock(SparseBlock.Type type, SparseBlock sblock, boolean forceCopy)`
`static SparseBlock`
SparseBlockFactory.`copySparseBlock(SparseBlock.Type type, SparseBlock sblock, boolean forceCopy, int clen)`
`static SparseBlock`
SparseBlockFactory.`createFromArray(double[] valsDense, int nCol, int nnz)`
Create a sparse block from an array.
`static SparseBlock`
SparseBlockFactory.`createIdentityMatrix(int nRowCol)`
`static SparseBlock`
SparseBlockFactory.`createIdentityMatrixWithEmptyRow(int nRowCol)`
`static SparseBlock`
SparseBlockFactory.`createSparseBlock(int rlen)`
`static SparseBlock`
SparseBlockFactory.`createSparseBlock(SparseBlock.Type type, int rlen)`
`static SparseBlock`
SparseBlockFactory.`createSparseBlock(SparseBlock.Type type, SparseRow row)`
`SparseBlock`
BasicTensorBlock.`getSparseBlock()`
Methods in org.apache.sysds.runtime.data with parameters of type SparseBlock
Modifier and Type
Method
Description
`static SparseBlock`
SparseBlockFactory.`copySparseBlock(SparseBlock.Type type, SparseBlock sblock, boolean forceCopy)`
`static SparseBlock`
SparseBlockFactory.`copySparseBlock(SparseBlock.Type type, SparseBlock sblock, boolean forceCopy, int clen)`
`boolean`
SparseBlock.`equals(SparseBlock o, double eps)`
Verify if the values in this sparse block is equivalent to that sparse block, not taking into account the dimensions of the contained values.
`boolean`
SparseBlock.`isAligned(int r, SparseBlock that)`
Indicates if all non-zero values of row r are aligned with the same row of the given second sparse block instance, which can be exploited for more efficient operations.
`boolean`
SparseBlock.`isAligned(SparseBlock that)`
Indicates if all non-zero values are aligned with the given second sparse block instance, which can be exploited for more efficient operations.
`static boolean`
SparseBlockFactory.`isSparseBlockType(SparseBlock sblock, SparseBlock.Type type)`
`void`
SparseBlockCSR.`setIndexRange(int rl, int ru, int cl, int cu, SparseBlock sb)`
Inserts a sparse block into the row and column range [rl,ru) and [cl,cu).
Constructors in org.apache.sysds.runtime.data with parameters of type SparseBlock
Modifier
Constructor
Description
``
`SparseBlockCOO(SparseBlock sblock)`
Copy constructor sparse block abstraction.
``
`SparseBlockCSC(SparseBlock sblock)`
``
`SparseBlockCSC(SparseBlock sblock, int clen)`
``
`SparseBlockCSR(SparseBlock sblock)`
Copy constructor sparse block abstraction.
``
`SparseBlockDCSR(SparseBlock sblock)`
Copy constructor sparse block abstraction.
``
`SparseBlockMCSC(SparseBlock sblock)`
``
`SparseBlockMCSC(SparseBlock sblock, int clen)`
``
`SparseBlockMCSR(SparseBlock sblock)`
Copy constructor sparse block abstraction.

## Uses of SparseBlock in org.apache.sysds.runtime.io

Methods in org.apache.sysds.runtime.io with parameters of type SparseBlock
Modifier and Type
Method
Description
`void`
ReaderTextCellParallel.CellBuffer.`flushCellBufferToSparseBlock(SparseBlock dest)`

## Uses of SparseBlock in org.apache.sysds.runtime.matrix.data

Methods in org.apache.sysds.runtime.matrix.data that return SparseBlock
Modifier and Type
Method
Description
`SparseBlock`
MatrixBlock.`getSparseBlock()`
Methods in org.apache.sysds.runtime.matrix.data with parameters of type SparseBlock
Modifier and Type
Method
Description
`void`
MatrixBlock.`appendRowToSparse(SparseBlock dest, MatrixBlock src, int i, int rowoffset, int coloffset, boolean deep)`
`long`
MatrixBlockDataInput.`readSparseRows(int rlen, long nnz, SparseBlock rows)`
Reads the sparse rows array from the data input into a sparse block and returns the number of non-zeros.
`void`
MatrixBlock.`setSparseBlock(SparseBlock sblock)`
`void`
MatrixBlockDataOutput.`writeSparseRows(int rlen, SparseBlock rows)`
Writes the sparse rows array of a sparse block to the data output.
Constructors in org.apache.sysds.runtime.matrix.data with parameters of type SparseBlock
Modifier
Constructor
Description
``
`MatrixBlock(int rl, int cl, long nnz, SparseBlock sblock)`
Constructs a sparse `MatrixBlock` with a given instance of a `SparseBlock`

## Uses of SparseBlock in org.apache.sysds.runtime.util

Methods in org.apache.sysds.runtime.util with parameters of type SparseBlock
Modifier and Type
Method
Description
`static long`
UtilFunctions.`computeNnz(SparseBlock a, int[] aix, int ai, int alen)`
`long`
ByteBufferDataInput.`readSparseRows(int rlen, long nnz, SparseBlock rows)`
`long`
FastBufferedDataInputStream.`readSparseRows(int rlen, long nnz, SparseBlock rows)`
`void`
FastBufferedDataOutputStream.`writeSparseRows(int rlen, SparseBlock rows)`