Package org.apache.sysds.runtime.compress.readers

## Class ReaderColumnSelection

- java.lang.Object
- - org.apache.sysds.runtime.compress.readers.ReaderColumnSelection

Direct Known Subclasses:
  `ReaderColumnSelectionDenseMultiBlock`, `ReaderColumnSelectionDenseMultiBlockTransposed`, `ReaderColumnSelectionDenseSingleBlock`, `ReaderColumnSelectionDenseSingleBlockTransposed`, `ReaderColumnSelectionEmpty`, `ReaderColumnSelectionSparse`, `ReaderColumnSelectionSparseTransposed`

    public abstract class ReaderColumnSelection
    extends Object

Base class for all column selection readers.

### Method Summary

All Methods Static Methods Instance Methods Concrete Methods
`static ReaderColumnSelection` `createReader​(MatrixBlock rawBlock, IColIndex colIndices, boolean transposed)` Create an reader of the matrix block that is able to iterate though all the rows and return as dense double arrays.
`static ReaderColumnSelection` `createReader​(MatrixBlock rawBlock, IColIndex colIndices, boolean transposed, int rl, int ru)` Create an reader of the matrix block that is able to iterate though all the rows and return as dense double arrays.
`int` `getCurrentRowIndex()` Get the current row index that the reader is at.
`DblArray` `nextRow()` Gets the next row, null when no more rows.

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Method Detail

#### nextRow

    public final DblArray nextRow()

Gets the next row, null when no more rows.

Returns:
  next row

#### getCurrentRowIndex

    public int getCurrentRowIndex()

Get the current row index that the reader is at.

Returns:
  The row index

#### createReader

    public static ReaderColumnSelection createReader​(MatrixBlock rawBlock,
                                                     IColIndex colIndices,
                                                     boolean transposed)

Create an reader of the matrix block that is able to iterate though all the rows and return as dense double arrays. Note the reader reuse the return, therefore if needed for something please copy the returned rows.

Parameters:
  `rawBlock` - The block to iterate though
  `colIndices` - The column indexes to extract and insert into the double array
  `transposed` - If the raw block should be treated as transposed
Returns:
  A reader of the columns specified

#### createReader

    public static ReaderColumnSelection createReader​(MatrixBlock rawBlock,
                                                     IColIndex colIndices,
                                                     boolean transposed,
                                                     int rl,
                                                     int ru)

Create an reader of the matrix block that is able to iterate though all the rows and return as dense double arrays. Note the reader reuse the return, therefore if needed for something please copy the returned rows.

Parameters:
  `rawBlock` - The block to iterate though
  `colIndices` - The column indexes to extract and insert into the double array
  `transposed` - If the raw block should be treated as transposed
  `rl` - The row to start at
  `ru` - The row to end at (not inclusive)
Returns:
  A reader of the columns specified