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

Packages that use SparseBlock
org.apache.sysds.runtime.compress
org.apache.sysds.runtime.controlprogram.caching
org.apache.sysds.runtime.data
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
`SparseBlock` CompressedMatrixBlock.`getSparseBlock()`

Methods in org.apache.sysds.runtime.compress with parameters of type SparseBlock
`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.controlprogram.caching

Methods in org.apache.sysds.runtime.controlprogram.caching with parameters of type SparseBlock
`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
`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` `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`

`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
`static SparseBlock` SparseBlockFactory.`copySparseBlock(SparseBlock.Type type, SparseBlock sblock, boolean forceCopy)`
`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
`static SparseBlock` SparseBlockFactory.`copySparseBlock(SparseBlock.Type type, SparseBlock sblock, boolean forceCopy)`
`static SparseBlock.Type` SparseBlockFactory.`getSparseBlockType(SparseBlock sblock)`
`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
Constructor and Description
`SparseBlockCOO(SparseBlock sblock)` Copy constructor sparse block abstraction.
`SparseBlockCSR(SparseBlock sblock)` Copy constructor sparse block abstraction.
`SparseBlockMCSR(SparseBlock sblock)` Copy constructor sparse block abstraction.

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

Methods in org.apache.sysds.runtime.matrix.data that return SparseBlock
`SparseBlock` MatrixBlock.`getSparseBlock()`

Methods in org.apache.sysds.runtime.matrix.data with parameters of type SparseBlock
`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
Constructor and 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
`static long` UtilFunctions.`computeNnz(SparseBlock a, int[] aix, int ai, int alen)`
`long` FastBufferedDataInputStream.`readSparseRows(int rlen, long nnz, SparseBlock rows)`
`long` ByteBufferDataInput.`readSparseRows(int rlen, long nnz, SparseBlock rows)`
`void` FastBufferedDataOutputStream.`writeSparseRows(int rlen, SparseBlock rows)`