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 Modifier and Type Method Description 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.
-
-
-
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 thoughcolIndices
- The column indexes to extract and insert into the double arraytransposed
- 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 thoughcolIndices
- The column indexes to extract and insert into the double arraytransposed
- If the raw block should be treated as transposedrl
- The row to start atru
- The row to end at (not inclusive)- Returns:
- A reader of the columns specified
-
-