File prediction_matrix_sparse_binary.hpp¶
Functions
-
std::unique_ptr<BinarySparsePredictionMatrix> createBinarySparsePredictionMatrix(const BinaryLilMatrix &lilMatrix, uint32 numCols, uint32 numNonZeroElements)¶
Creates and returns a new object of the type
BinarySparsePredictionMatrix
as a copy of an existingBinaryLilMatrix
.- Parameters:
lilMatrix – A reference to an object of type
BinaryLilMatrix
to be copiednumCols – The number of columns of the given
BinaryLilMatrix
numNonZeroElements – The number of non-zero elements in the given
BinaryLilMatrix
- Returns:
An unique pointer to an object of type
BinarySparsePredictionMatrix
that 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 numNonZeroElements)¶
- Parameters:
lilMatrix – A reference to an object of type
BinaryLilMatrix
to be copiednumCols – The number of columns of the given
BinaryLilMatrix
numNonZeroElements – The number of non-zero elements in the given
BinaryLilMatrix
-
BinarySparsePredictionView(BinarySparsePredictionView &&other)¶
- Parameters:
other – A reference to an object of type
BinarySparsePredictionView
that should be moved
-
BinarySparsePredictionView(const BinaryLilMatrix &lilMatrix, uint32 numCols, uint32 numNonZeroElements)¶
-
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 numNonZeroElements)¶
- Parameters:
lilMatrix – A reference to an object of type
BinaryLilMatrix
to be copiednumCols – The number of columns of the given
BinaryLilMatrix
numNonZeroElements – The number of non-zero elements in the given
BinaryLilMatrix
-
uint32 *getIndices()¶
Returns a pointer to the array that stores the column indices, the non-zero values in the matrix correspond to.
- Returns:
A pointer to the array that stores the column indices, the non-zero values in the matrix correspond to
-
uint32 *releaseIndices()¶
Releases the ownership of the array that stores the column indices, the non-zero values in the matrix correspond to. 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, the non-zero values in the matrix correspond to
-
uint32 *getIndptr()¶
Returns a pointer to the array that stores the indices of the first non-zero element that corresponds to a certain row.
- Returns:
A pointer to the array that stores the indices of the first non-zero element that corresponds to a certain row
-
uint32 *releaseIndptr()¶
Releases the ownership of the array that stores the indices of the first non-zero 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 non-zero element that corresponds to a certain row
-
BinarySparsePredictionMatrix(const BinaryLilMatrix &lilMatrix, uint32 numCols, uint32 numNonZeroElements)¶