File body_conjunctive.hpp

class ConjunctiveBody : public IBody
#include <body_conjunctive.hpp>

A body that consists of a conjunction of conditions using the operators <= or > for numerical conditions, and = or != for nominal conditions, respectively.

Public Types

typedef View<float32>::iterator numerical_threshold_iterator

An iterator that provides access to the thresholds that are used by numerical conditions in the body and allows to modify them.

typedef View<float32>::const_iterator numerical_threshold_const_iterator

An iterator that provides read-only access to the thresholds that are used by numerical conditions in the body.

typedef View<int32>::iterator ordinal_threshold_iterator

An iterator that provides access to the thresholds that are used by ordinal conditions in the body and allows to modify them.

typedef View<int32>::const_iterator ordinal_threshold_const_iterator

An iterator that provides read-only access to the thresholds that are used by ordinal conditions in the body.

typedef View<int32>::iterator nominal_threshold_iterator

An iterator that provides access to the threshold that are used by nominal conditions in the body and allows to modify them.

typedef View<int32>::const_iterator nominal_threshold_const_iterator

An iterator that provides read-only access to the thresholds that are used by nominal conditions in the body.

typedef View<uint32>::iterator index_iterator

An iterator that provides access to the feature indices that correspond to the conditions in the body and allows to modify them.

typedef View<uint32>::const_iterator index_const_iterator

An iterator that provides read-only access to the feature indices that correspond to the conditions in the body.

Public Functions

ConjunctiveBody(uint32 numNumericalLeq, uint32 numNumericalGr, uint32 numOrdinalLeq, uint32 numOrdinalGr, uint32 numNominalEq, uint32 numNominalNeq)
Parameters:
  • numNumericalLeq – The number of numerical conditions that use the <= operator

  • numNumericalGr – The number of numerical conditions that use the > operator

  • numOrdinalLeq – The number of ordinal conditions that use the <= operator

  • numOrdinalGr – The number of ordinal conditions that use the > operator

  • numNominalEq – The number of nominal conditions that use the == operator

  • numNominalNeq – The number of nominal conditions that use the != operator

uint32 getNumNumericalLeq() const

Returns the number of numerical conditions that use the <= operator.

Returns:

The number of conditions

numerical_threshold_iterator numerical_leq_thresholds_begin()

Returns a numerical_threshold_iterator to the beginning of the thresholds that correspond to numerical conditions that use the <= operator.

Returns:

A numerical_threshold_iterator to the beginning

numerical_threshold_iterator numerical_leq_thresholds_end()

Returns a numerical_threshold_iterator to the end of the thresholds that correspond to numerical conditions that use the <= operator.

Returns:

A numerical_threshold_iterator to the end

numerical_threshold_const_iterator numerical_leq_thresholds_cbegin() const

Returns a numerical_threshold_const_iterator to the beginning of the thresholds that correspond to numerical conditions that use the <= operator.

Returns:

A numerical_threshold_const_iterator to the beginning

numerical_threshold_const_iterator numerical_leq_thresholds_cend() const

Returns a numerical_threshold_const_iterator to the end of the thresholds that correspond to numerical conditions that use the <= operator.

Returns:

A numerical_threshold_const_iterator to the end

index_iterator numerical_leq_indices_begin()

Returns an index_iterator to the beginning of the feature indices that correspond to numerical conditions that use the <= operator.

Returns:

An index_iterator to the beginning

index_iterator numerical_leq_indices_end()

Returns an index_iterator to the end of the feature indices that correspond to numerical conditions that use the <= operator.

Returns:

An index_iterator to the end

index_const_iterator numerical_leq_indices_cbegin() const

Returns an index_const_iterator to the beginning of the feature indices that correspond to numerical conditions that use the <= operator.

Returns:

An index_const_iterator to the beginning

index_const_iterator numerical_leq_indices_cend() const

Returns an index_const_iterator to the end of the feature indices that correspond to numerical conditions that use the <= operator.

Returns:

An index_const_iterator to the end

uint32 getNumNumericalGr() const

Returns the number of numerical conditions that use the > operator.

Returns:

The number of conditions

numerical_threshold_iterator numerical_gr_thresholds_begin()

Returns a numerical_threshold_iterator to the beginning of the thresholds that correspond to numerical conditions that use the > operator.

Returns:

A numerical_threshold_iterator to the beginning

numerical_threshold_iterator numerical_gr_thresholds_end()

Returns a numerical_threshold_iterator to the end of the thresholds that correspond to numerical conditions that use the > operator.

Returns:

A numerical_threshold_iterator to the end

numerical_threshold_const_iterator numerical_gr_thresholds_cbegin() const

Returns a numerical_threshold_const_iterator to the beginning of the thresholds that correspond to numerical conditions that use the > operator.

Returns:

A numerical_threshold_const_iterator to the beginning

numerical_threshold_const_iterator numerical_gr_thresholds_cend() const

Returns a numerical_threshold_const_iterator to the end of the thresholds that correspond to numerical conditions that use the > operator.

Returns:

A numerical_threshold_const_iterator to the end

index_iterator numerical_gr_indices_begin()

Returns an index_iterator to the beginning of the feature indices that correspond to numerical conditions that use the > operator.

Returns:

An index_iterator to the beginning

index_iterator numerical_gr_indices_end()

Returns an index_iterator to the end of the feature indices that correspond to numerical conditions that use the > operator.

Returns:

An index_iterator to the end

index_const_iterator numerical_gr_indices_cbegin() const

Returns an index_const_iterator to the beginning of the feature indices that correspond to numerical conditions that use the > operator.

Returns:

An index_const_iterator to the beginning

index_const_iterator numerical_gr_indices_cend() const

Returns an index_const_iterator to the end of the feature indices that correspond to numerical conditions that use the > operator.

Returns:

An index_const_iterator to the end

uint32 getNumOrdinalLeq() const

Returns the number of ordinal conditions that use the <= operator.

Returns:

The number of conditions

ordinal_threshold_iterator ordinal_leq_thresholds_begin()

Returns an ordinal_threshold_iterator to the beginning of the thresholds that correspond to ordinal conditions that use the <= operator.

Returns:

An ordinal_threshold_iterator to the beginning

ordinal_threshold_iterator ordinal_leq_thresholds_end()

Returns an ordinal_threshold_iterator to the end of the thresholds that correspond to ordinal conditions that use the <= operator.

Returns:

An ordinal_threshold_iterator to the end

ordinal_threshold_const_iterator ordinal_leq_thresholds_cbegin() const

Returns an ordinal_threshold_const_iterator to the beginning of the thresholds that correspond to ordinal conditions that use the <= operator.

Returns:

An ordinal_threshold_const_iterator to the beginning

ordinal_threshold_const_iterator ordinal_leq_thresholds_cend() const

Returns an ordinal_threshold_const_iterator to the end of the thresholds that correspond to ordinal conditions that use the <= operator.

Returns:

An ordinal_threshold_const_iterator to the end

index_iterator ordinal_leq_indices_begin()

Returns an index_iterator to the beginning of the feature indices that correspond to ordinal conditions that use the <= operator.

Returns:

An index_iterator to the beginning

index_iterator ordinal_leq_indices_end()

Returns an index_iterator to the end of the feature indices that correspond to ordinal conditions that use the <= operator.

Returns:

An index_iterator to the end

index_const_iterator ordinal_leq_indices_cbegin() const

Returns an index_const_iterator to the beginning of the feature indices that correspond to ordinal conditions that use the <= operator.

Returns:

An index_const_iterator to the beginning

index_const_iterator ordinal_leq_indices_cend() const

Returns an index_const_iterator to the end of the feature indices that correspond to ordinal conditions that use the <= operator.

Returns:

An index_const_iterator to the end

uint32 getNumOrdinalGr() const

Returns the number of ordinal conditions that use the > operator.

Returns:

The number of conditions

ordinal_threshold_iterator ordinal_gr_thresholds_begin()

Returns an ordinal_threshold_iterator to the beginning of the thresholds that correspond to ordinal conditions that use the > operator.

Returns:

An ordinal_threshold_iterator to the beginning

ordinal_threshold_iterator ordinal_gr_thresholds_end()

Returns an ordinal_threshold_iterator to the end of the thresholds that correspond to ordinal conditions that use the > operator.

Returns:

An ordinal_threshold_iterator to the end

ordinal_threshold_const_iterator ordinal_gr_thresholds_cbegin() const

Returns an ordinal_threshold_const_iterator to the beginning of the thresholds that correspond to ordinal conditions that use the > operator.

Returns:

An ordinal_threshold_const_iterator to the beginning

ordinal_threshold_const_iterator ordinal_gr_thresholds_cend() const

Returns an ordinal_threshold_const_iterator to the end of the thresholds that correspond to ordinal conditions that use the > operator.

Returns:

An ordinal_threshold_const_iterator to the end

index_iterator ordinal_gr_indices_begin()

Returns an index_iterator to the beginning of the feature indices that correspond to ordinal conditions that use the > operator.

Returns:

An index_iterator to the beginning

index_iterator ordinal_gr_indices_end()

Returns an index_iterator to the end of the feature indices that correspond to ordinal conditions that use the > operator.

Returns:

An index_iterator to the end

index_const_iterator ordinal_gr_indices_cbegin() const

Returns an index_const_iterator to the beginning of the feature indices that correspond to ordinal conditions that use the > operator.

Returns:

An index_const_iterator to the beginning

index_const_iterator ordinal_gr_indices_cend() const

Returns an index_const_iterator to the end of the feature indices that correspond to ordinal conditions that use the > operator.

Returns:

An index_const_iterator to the end

uint32 getNumNominalEq() const

Returns the number of nominal conditions that use the == operator.

Returns:

The number of conditions

nominal_threshold_iterator nominal_eq_thresholds_begin()

Returns a nominal_threshold_iterator to the beginning of the thresholds that correspond to nominal conditions that use the == operator.

Returns:

A nominal_threshold_iterator to the beginning

nominal_threshold_iterator nominal_eq_thresholds_end()

Returns a nominal_threshold_iterator to the end of the thresholds that correspond to nominal conditions that use the == operator.

Returns:

A nominal_threshold_iterator to the end

nominal_threshold_const_iterator nominal_eq_thresholds_cbegin() const

Returns a nominal_threshold_const_iterator to the beginning of the thresholds that correspond to nominal conditions that use the == operator.

Returns:

A nominal_threshold_const_iterator to the beginning

nominal_threshold_const_iterator nominal_eq_thresholds_cend() const

Returns a nominal_threshold_const_iterator to the end of the thresholds that correspond to nominal conditions that use the == operator.

Returns:

A nominal_threshold_const_iterator to the end

index_iterator nominal_eq_indices_begin()

Returns an index_iterator to the beginning of the feature indices that correspond to nominal conditions that use the == operator.

Returns:

An index_iterator to the beginning

index_iterator nominal_eq_indices_end()

Returns an index_iterator to the end of the feature indices that correspond to nominal conditions that use the == operator.

Returns:

An index_iterator to the end

index_const_iterator nominal_eq_indices_cbegin() const

Returns an index_const_iterator to the beginning of the feature indices that correspond to nominal conditions that use the == operator.

Returns:

An index_const_iterator to the beginning

index_const_iterator nominal_eq_indices_cend() const

Returns an index_const_iterator to the end of the feature indices that correspond to nominal conditions that use the == operator.

Returns:

An index_const_iterator to the end

uint32 getNumNominalNeq() const

Returns the number of nominal conditions that use the != operator.

Returns:

The number of conditions

nominal_threshold_iterator nominal_neq_thresholds_begin()

Returns a nominal_threshold_iterator to the beginning of the thresholds that correspond to nominal conditions that use the != operator.

Returns:

A nominal_threshold_iterator to the beginning

nominal_threshold_iterator nominal_neq_thresholds_end()

Returns a nominal_threshold_iterator to the end of the thresholds that correspond to nominal conditions that use the != operator.

Returns:

A nominal_threshold_iterator to the end

nominal_threshold_const_iterator nominal_neq_thresholds_cbegin() const

Returns a nominal_threshold_const_iterator to the beginning of the thresholds that correspond to nominal conditions that use the != operator.

Returns:

A nominal_threshold_const_iterator to the beginning

nominal_threshold_const_iterator nominal_neq_thresholds_cend() const

Returns a nominal_threshold_const_iterator to the end of the thresholds that correspond to nominal conditions that use the != operator.

Returns:

A nominal_threshold_const_iterator to the end

index_iterator nominal_neq_indices_begin()

Returns an index_iterator to the beginning of the feature indices that correspond to nominal conditions that use the != operator.

Returns:

An index_iterator to the beginning

index_iterator nominal_neq_indices_end()

Returns an index_iterator to the end of the feature indices that correspond to nominal conditions that use the != operator.

Returns:

An index_iterator to the end

index_const_iterator nominal_neq_indices_cbegin() const

Returns an index_const_iterator to the beginning of the feature indices that correspond to nominal conditions that use the != operator.

Returns:

An index_const_iterator to the beginning

index_const_iterator nominal_neq_indices_cend() const

Returns an index_const_iterator to the end of the feature indices that correspond to nominal conditions that use the != operator.

Returns:

An index_const_iterator to the end

virtual bool covers(View<const float32>::const_iterator begin, View<const float32>::const_iterator end) const override

virtual bool covers(View<uint32>::const_iterator indicesBegin, View<uint32>::const_iterator indicesEnd, View<float32>::const_iterator valuesBegin, View<float32>::const_iterator valuesEnd, float32 sparseValue, View<float32>::iterator tmpArray1, View<uint32>::iterator tmpArray2, uint32 n) const override

virtual void visit(EmptyBodyVisitor emptyBodyVisitor, ConjunctiveBodyVisitor conjunctiveBodyVisitor) const override

Invokes one of the given visitor functions, depending on which one is able to handle this particular type of body.

Parameters:
  • emptyBodyVisitor – The visitor function for handling objects of the type EmptyBody

  • conjunctiveBodyVisitor – The visitor function for handling objects of the type ConjunctiveBody

struct CompareNominalEq

Allows to compare nominal feature values to threshold using the == operator.

Public Functions

inline bool operator()(const int32 &featureValue, const int32 &threshold) const

Returns whether a given feature value satisfies a specific threshold or not.

Parameters:
  • featureValue – The feature value

  • threshold – The threshold

Returns:

True, if the feature value satisfies the threshold, false otherwise

struct CompareNominalNeq

Allows to compare nominal feature values to threshold using the != operator.

Public Functions

inline bool operator()(const int32 &featureValue, const int32 &threshold) const

Returns whether a given feature value satisfies a specific threshold or not.

Parameters:
  • featureValue – The feature value

  • threshold – The threshold

Returns:

True, if the feature value satisfies the threshold, false otherwise

struct CompareNumericalGr

Allows to compare numerical feature values to threshold using the > operator.

Public Functions

inline bool operator()(const float32 &featureValue, const float32 &threshold) const

Returns whether a given feature value satisfies a specific threshold or not.

Parameters:
  • featureValue – The feature value

  • threshold – The threshold

Returns:

True, if the feature value satisfies the threshold, false otherwise

struct CompareNumericalLeq

Allows to compare numerical feature values to threshold using the <= operator.

Public Functions

inline bool operator()(const float32 &featureValue, const float32 &threshold) const

Returns whether a given feature value satisfies a specific threshold or not.

Parameters:
  • featureValue – The feature value

  • threshold – The threshold

Returns:

True, if the feature value satisfies the threshold, false otherwise

struct CompareOrdinalGr

Allows to compare ordinal feature values to threshold using the > operator.

Public Functions

inline bool operator()(const int32 &featureValue, const int32 &threshold) const

Returns whether a given feature value satisfies a specific threshold or not.

Parameters:
  • featureValue – The feature value

  • threshold – The threshold

Returns:

True, if the feature value satisfies the threshold, false otherwise

struct CompareOrdinalLeq

Allows to compare ordinal feature values to threshold using the <= operator.

Public Functions

inline bool operator()(const int32 &featureValue, const int32 &threshold) const

Returns whether a given feature value satisfies a specific threshold or not.

Parameters:
  • featureValue – The feature value

  • threshold – The threshold

Returns:

True, if the feature value satisfies the threshold, false otherwise

template<typename Threshold, typename Compare>
class ConditionVector : public IterableIndexedVectorDecorator<IndexedVectorDecorator<AllocatedVector<uint32>, AllocatedVector<Threshold>>>, public IConditional

A vector that stores conditions of a specific type.

Template Parameters:
  • Threshold – The type of the thresholds used by the conditions

  • Compare – The type of the comparator that should be used to compare thresholds to feature values

Public Functions

ConditionVector(uint32 numConditions)
Parameters:

numConditions – The number of conditions

bool covers(View<const float32>::const_iterator begin, View<const float32>::const_iterator end) const override

bool covers(View<uint32>::const_iterator indicesBegin, View<uint32>::const_iterator indicesEnd, View<float32>::const_iterator valuesBegin, View<float32>::const_iterator valuesEnd, float32 sparseValue, View<float32>::iterator tmpArray1, View<uint32>::iterator tmpArray2, uint32 n) const override

Private Members

Compare compare_