File prediction_matrix_sparse_binary.hpp¶
Functions
-
std::unique_ptr<BinarySparsePredictionMatrix> createBinarySparsePredictionMatrix(const BinaryLilMatrix &lilMatrix, uint32 numCols, uint32 numDenseElements)¶
Creates and returns a new object of the type
BinarySparsePredictionMatrixas a copy of an existingBinaryLilMatrix.- Parameters:
lilMatrix – A reference to an object of type
BinaryLilMatrixto be copiednumCols – The number of columns in the given
BinaryLilMatrixnumDenseElements – The number of dense elements explicitly stored in the given
BinaryLilMatrix
- Returns:
An unique pointer to an object of type
BinarySparsePredictionMatrixthat has been created
-
class BinarySparsePredictionView : public BinaryCsrViewAllocator<BinaryCsrView>¶
- #include <prediction_matrix_sparse_binary.hpp>
A two-dimensional view that provides row-wise access to binary values stored in a matrix in the compressed sparse row (CSR) format that have been copied from a
BinaryLilMatrix.Public Functions
-
BinarySparsePredictionView(const BinaryLilMatrix &lilMatrix, uint32 numCols, uint32 numDenseElements)¶
- Parameters:
lilMatrix – A reference to an object of type
BinaryLilMatrixto be copiednumCols – The number of columns of the given
BinaryLilMatrixnumDenseElements – The number of dense elements explicitly stored in the given
BinaryLilMatrix
-
BinarySparsePredictionView(BinarySparsePredictionView &&other)¶
- Parameters:
other – A reference to an object of type
BinarySparsePredictionViewthat should be moved
-
BinarySparsePredictionView(const BinaryLilMatrix &lilMatrix, uint32 numCols, uint32 numDenseElements)¶
-
class BinarySparsePredictionMatrix : public IterableBinarySparseMatrixDecorator<MatrixDecorator<BinarySparsePredictionView>>¶
- #include <prediction_matrix_sparse_binary.hpp>
A sparse matrix that provides read-only access to binary predictions that are stored in the compressed sparse row (CSR) format.
Public Functions
-
BinarySparsePredictionMatrix(const BinaryLilMatrix &lilMatrix, uint32 numCols, uint32 numDenseElements)¶
- Parameters:
lilMatrix – A reference to an object of type
BinaryLilMatrixto be copiednumCols – The number of columns in the given
BinaryLilMatrixnumDenseElements – The number of dense elements explicitly stored in the given
BinaryLilMatrix
-
uint32 *getIndices()¶
Returns a pointer to the array that stores the column indices of all dense elements explicitly stored in the matrix.
- Returns:
A pointer to the array that stores the column indices of all dense elements explicitly stored in the matrix
-
uint32 *releaseIndices()¶
Releases the ownership of the array that stores the column indices of all dense elements explicitly stored in the matrix. As a result, the behavior of this matrix becomes undefined and it should not be used anymore. The caller is responsible for freeing the memory that is occupied by the array.
- Returns:
A pointer to the array that stores the column indices of all dense elements explicitly stored in the matrix
-
uint32 *getIndptr()¶
Returns a pointer to the array that stores the indices of the first dense element that corresponds to a certain row.
- Returns:
A pointer to the array that stores the indices of the first dense element that corresponds to a certain row
-
uint32 *releaseIndptr()¶
Releases the ownership of the array that stores the indices of the first dense element that corresponds to a certain row. As a result, the behavior of this matrix becomes undefined and it should not be used anymore. The caller is responsible for freeing the memory that is occupied by the array.
- Returns:
A pointer to an array that stores the indices of the first dense element that corresponds to a certain row
-
BinarySparsePredictionMatrix(const BinaryLilMatrix &lilMatrix, uint32 numCols, uint32 numDenseElements)¶