File view_vector_compressed.hpp

class CompressedVector : public CompressedView
#include <view_vector_compressed.hpp>

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

Subclassed by BinnedFeatureVector, NominalFeatureVector

Public Types

using index_const_iterator = const uint32*

An iterator that provides read-only access to the indices.

using index_iterator = uint32*

An iterator that provides access to the indices and allows to modify them.

Public Functions

inline CompressedVector(uint32 *indices, uint32 *indptr, uint32 numBins)
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

  • numBins – The number of bins

inline CompressedVector(const CompressedVector &other)
Parameters:

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

inline CompressedVector(CompressedVector &&other)
Parameters:

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

inline virtual ~CompressedVector() override
inline index_const_iterator indices_cbegin(uint32 index) const

Returns an index_const_iterator to the beginning of the indices that are associated with a specific bin.

Parameters:

index – The index of the nominal value

Returns:

An index_const_iterator to the beginning

inline index_const_iterator indices_cend(uint32 index) const

Returns an index_const_iterator to the end of the indices of the examples that are associated with a specific bin.

Parameters:

index – The index of the bin

Returns:

An index_const_iterator to the end

inline index_iterator indices_begin(uint32 index)

Returns an index_iterator to the beginning of the indices of the examples that are associated with a specific bin.

Parameters:

index – The index of the bin

Returns:

An index_iterator to the beginning

inline index_iterator indices_end(uint32 index)

Returns an index_iterator to the end of the indices of the examples that are associated with a specific bin.

Parameters:

index – The index of the bin

Returns:

An index_iterator to the end

Public Members

uint32 numBins

The number of bins.