File view_compressed.hpp

class CompressedView
#include <view_compressed.hpp>

A view that provides access to indices that have been grouped into bins.

Subclassed by BinarySparseMatrix, CompressedVector

Public Types

using index_type = uint32

The type of the indices, the view provides access to.

Public Functions

inline CompressedView(uint32 *indices, uint32 *indptr)
Parameters:
  • indices – A pointer to an array of type uint32, shape (numIndices) that stores indices

  • indptr – A pointer to an array that stores the indices of the first element in indices that corresponds to a certain bin

inline CompressedView(const CompressedView &other)
Parameters:

other – A reference to an object of type CompressedView that should be copied

inline CompressedView(CompressedView &&other)
Parameters:

other – A reference to an object of type CompressedView that should be moved

inline virtual ~CompressedView()
inline index_type *releaseIndices()

Releases the ownership of the array that stores the indices. As a result, the behavior of this view 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 indices

inline index_type *releaseIndptr()

Releases the ownership of the array that stores the indices of the first element in indices that corresponds to a certain bin. As a result, the behavior of this view 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 element in indices that corresponds to a certain bin

Public Members

uint32 *indices

A pointer to an array that stores indices.

uint32 *indptr

A pointer to an array that stores the indices of the first element in indices that corresponds to a certain bin.