From bd6e4356d146863a1b1ce0cb1a9990283cbd42e1 Mon Sep 17 00:00:00 2001 From: Michael Rapp Date: Thu, 12 Oct 2023 15:06:23 +0200 Subject: [PATCH] Remove field "order_" from class OrdinalFeatureVector. --- .../common/input/feature_vector_ordinal.hpp | 39 ------------------- .../common/input/feature_vector_ordinal.cpp | 22 +---------- 2 files changed, 1 insertion(+), 60 deletions(-) diff --git a/cpp/subprojects/common/include/mlrl/common/input/feature_vector_ordinal.hpp b/cpp/subprojects/common/include/mlrl/common/input/feature_vector_ordinal.hpp index 20dc8f2918..953d0d5937 100644 --- a/cpp/subprojects/common/include/mlrl/common/input/feature_vector_ordinal.hpp +++ b/cpp/subprojects/common/include/mlrl/common/input/feature_vector_ordinal.hpp @@ -10,10 +10,6 @@ * value, i.e., the most frequent value, of an ordinal feature. */ class OrdinalFeatureVector : public NominalFeatureVector { - private: - - uint32* order_; - public: /** @@ -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; }; diff --git a/cpp/subprojects/common/src/mlrl/common/input/feature_vector_ordinal.cpp b/cpp/subprojects/common/src/mlrl/common/input/feature_vector_ordinal.cpp index 8fdfe09795..ef5c8a0388 100644 --- a/cpp/subprojects/common/src/mlrl/common/input/feature_vector_ordinal.cpp +++ b/cpp/subprojects/common/src/mlrl/common/input/feature_vector_ordinal.cpp @@ -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) {}