Skip to content

Commit

Permalink
Remove field "order_" from class OrdinalFeatureVector.
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-rapp committed Oct 12, 2023
1 parent 03c75fb commit bd6e435
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 60 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@
* value, i.e., the most frequent value, of an ordinal feature.
*/
class OrdinalFeatureVector : public NominalFeatureVector {
private:

uint32* order_;

public:

/**
Expand All @@ -23,39 +19,4 @@ class OrdinalFeatureVector : public NominalFeatureVector {
* @param majorityValue The majority value, i.e., the most frequent value, of the ordinal feature
*/
OrdinalFeatureVector(uint32 numValues, uint32 numExamples, int32 majorityValue);

~OrdinalFeatureVector() override;

/**
* Returns an `index_iterator` to the beginning of the ordered indices of the values of the ordinal feature.
*
* @param index The index of the value
* @return An `index_iterator` to the beginning
*/
index_iterator order_begin(uint32 index);

/**
* Returns an `index_iterator` to the end of the ordered indices of the values of the ordinal feature.
*
* @param index The index of the value
* @return An `index_iterator` to the end
*/
index_iterator order_end(uint32 index);

/**
* Returns an `index_const_iterator` to the beginning of the ordered indices of the values of the ordinal
* feature.
*
* @param index The index of the value
* @return An `index_const_iterator` to the beginning
*/
index_const_iterator order_cbegin(uint32 index) const;

/**
* Returns an `index_const_iterator` to the end of the ordered indices of the values of the ordinal feature.
*
* @param index The index of the value
* @return An `index_const_iterator` to the end
*/
index_const_iterator order_cend(uint32 index) const;
};
Original file line number Diff line number Diff line change
@@ -1,24 +1,4 @@
#include "mlrl/common/input/feature_vector_ordinal.hpp"

OrdinalFeatureVector::OrdinalFeatureVector(uint32 numValues, uint32 numExamples, int32 majorityValue)
: NominalFeatureVector(numValues, numExamples, majorityValue), order_(new uint32[numValues]) {}

OrdinalFeatureVector::~OrdinalFeatureVector() {
delete[] order_;
}

OrdinalFeatureVector::index_iterator OrdinalFeatureVector::order_begin(uint32 index) {
return order_;
}

OrdinalFeatureVector::index_iterator OrdinalFeatureVector::order_end(uint32 index) {
return &order_[this->getNumElements()];
}

OrdinalFeatureVector::index_const_iterator OrdinalFeatureVector::order_cbegin(uint32 index) const {
return order_;
}

OrdinalFeatureVector::index_const_iterator OrdinalFeatureVector::order_cend(uint32 index) const {
return &order_[this->getNumElements()];
}
: NominalFeatureVector(numValues, numExamples, majorityValue) {}

0 comments on commit bd6e435

Please sign in to comment.