File index_vector_partial.hpp

class PartialIndexVector : public ResizableVectorDecorator<DenseVectorDecorator<ResizableVector<uint32>>>, public IIndexVector
#include <index_vector_partial.hpp>

Provides random access to a fixed number of indices stored in a C-contiguous array.

Public Functions

PartialIndexVector(uint32 numElements, bool init = false)
Parameters:
  • numElements – The number of elements in the vector

  • init – True, if all elements in the vector should be value-initialized, false otherwise

virtual uint32 getNumElements() const override

Returns the number of indices.

Returns:

The number of indices

virtual bool isPartial() const override

Returns whether the indices are partial, i.e., some indices in the range [0, getNumElements()) are missing, or not.

Returns:

True, if the indices are partial, false otherwise

virtual uint32 getIndex(uint32 pos) const override

Returns the index at a specific position.

Parameters:

pos – The position of the index. Must be in [0, getNumElements())

Returns:

The index at the given position

virtual std::unique_ptr<IRuleRefinement> createRuleRefinement(IFeatureSubspace &featureSubspace, uint32 featureIndex) const override

Creates and return a new instance of type IRuleRefinement that allows to search for the best refinement of an existing rule that predicts only for the labels whose indices are stored in this vector.

Parameters:
  • featureSubspace – A reference to an object of type IFeatureSubspace that should be to search for the refinement

  • featureIndex – The index of the feature that should be considered when searching for the refinement

Returns:

An unique pointer to an object of type IRuleRefinement that has been created