From 844372fadebef52ec3faef6200f7ec9722c4feff Mon Sep 17 00:00:00 2001 From: Michael Rapp Date: Thu, 3 Oct 2024 00:54:32 +0200 Subject: [PATCH] Remove functions "getNumSamples" and "setNumSamples" from class IOutputSamplingWithoutReplacementConfig. --- .../output_sampling_without_replacement.hpp | 22 ------------------- .../output_sampling_without_replacement.cpp | 12 +--------- .../mlrl/common/cython/output_sampling.pxd | 4 ---- .../mlrl/common/cython/output_sampling.pyx | 20 ----------------- 4 files changed, 1 insertion(+), 57 deletions(-) diff --git a/cpp/subprojects/common/include/mlrl/common/sampling/output_sampling_without_replacement.hpp b/cpp/subprojects/common/include/mlrl/common/sampling/output_sampling_without_replacement.hpp index 82b92678b..b59068b5a 100644 --- a/cpp/subprojects/common/include/mlrl/common/sampling/output_sampling_without_replacement.hpp +++ b/cpp/subprojects/common/include/mlrl/common/sampling/output_sampling_without_replacement.hpp @@ -65,22 +65,6 @@ class MLRLCOMMON_API IOutputSamplingWithoutReplacementConfig { * further configuration of the method for sampling instances */ virtual IOutputSamplingWithoutReplacementConfig& setMaxSamples(uint32 maxSamples) = 0; - - /** - * Returns the number of outputs that are included in a sample. - * - * @return The number of outputs that are included in a sample - */ - virtual uint32 getNumSamples() const = 0; - - /** - * Sets the number of outputs that should be included in a sample. - * - * @param numSamples The number of outputs that should be included in a sample. Must be at least 1 - * @return A reference to an object of type `IOutputSamplingWithoutReplacementConfig` that allows - * further configuration of the sampling method - */ - virtual IOutputSamplingWithoutReplacementConfig& setNumSamples(uint32 numSamples) = 0; }; /** @@ -98,8 +82,6 @@ class OutputSamplingWithoutReplacementConfig final : public IOutputSamplingConfi uint32 maxSamples_; - uint32 numSamples_; - public: /** @@ -120,10 +102,6 @@ class OutputSamplingWithoutReplacementConfig final : public IOutputSamplingConfi IOutputSamplingWithoutReplacementConfig& setMaxSamples(uint32 maxSamples) override; - uint32 getNumSamples() const override; - - IOutputSamplingWithoutReplacementConfig& setNumSamples(uint32 numSamples) override; - std::unique_ptr createOutputSamplingFactory( const IOutputMatrix& outputMatrix) const override; }; diff --git a/cpp/subprojects/common/src/mlrl/common/sampling/output_sampling_without_replacement.cpp b/cpp/subprojects/common/src/mlrl/common/sampling/output_sampling_without_replacement.cpp index d54d707c2..8ff21b8aa 100644 --- a/cpp/subprojects/common/src/mlrl/common/sampling/output_sampling_without_replacement.cpp +++ b/cpp/subprojects/common/src/mlrl/common/sampling/output_sampling_without_replacement.cpp @@ -68,7 +68,7 @@ class OutputSamplingWithoutReplacementFactory final : public IOutputSamplingFact }; OutputSamplingWithoutReplacementConfig::OutputSamplingWithoutReplacementConfig(ReadableProperty rngConfig) - : rngConfig_(rngConfig), sampleSize_(0.33f), minSamples_(1), maxSamples_(1), numSamples_(1) {} + : rngConfig_(rngConfig), sampleSize_(0.33f), minSamples_(1), maxSamples_(1) {} float32 OutputSamplingWithoutReplacementConfig::getSampleSize() const { return sampleSize_; @@ -101,16 +101,6 @@ IOutputSamplingWithoutReplacementConfig& OutputSamplingWithoutReplacementConfig: return *this; } -uint32 OutputSamplingWithoutReplacementConfig::getNumSamples() const { - return numSamples_; -} - -IOutputSamplingWithoutReplacementConfig& OutputSamplingWithoutReplacementConfig::setNumSamples(uint32 numSamples) { - util::assertGreaterOrEqual("numSamples", numSamples, 1); - numSamples_ = numSamples; - return *this; -} - std::unique_ptr OutputSamplingWithoutReplacementConfig::createOutputSamplingFactory( const IOutputMatrix& outputMatrix) const { uint32 numOutputs = outputMatrix.getNumOutputs(); diff --git a/python/subprojects/common/mlrl/common/cython/output_sampling.pxd b/python/subprojects/common/mlrl/common/cython/output_sampling.pxd index e8eb6c8a6..63e6ba026 100644 --- a/python/subprojects/common/mlrl/common/cython/output_sampling.pxd +++ b/python/subprojects/common/mlrl/common/cython/output_sampling.pxd @@ -19,10 +19,6 @@ cdef extern from "mlrl/common/sampling/output_sampling_without_replacement.hpp" IOutputSamplingWithoutReplacementConfig& setMaxSamples(float32 maxSamples) - uint32 getNumSamples() const - - IOutputSamplingWithoutReplacementConfig& setNumSamples(uint32 numSamples) except + - cdef class OutputSamplingWithoutReplacementConfig: diff --git a/python/subprojects/common/mlrl/common/cython/output_sampling.pyx b/python/subprojects/common/mlrl/common/cython/output_sampling.pyx index 0f54cb888..399a06b14 100644 --- a/python/subprojects/common/mlrl/common/cython/output_sampling.pyx +++ b/python/subprojects/common/mlrl/common/cython/output_sampling.pyx @@ -72,23 +72,3 @@ cdef class OutputSamplingWithoutReplacementConfig: assert_greater_or_equal('max_samples', max_samples, self.get_min_samples()) self.config_ptr.setMaxSamples(max_samples) return self - - def get_num_samples(self) -> int: - """ - Returns the number of outputs that are included in a sample. - - :return: The number of outputs that are included in a sample - """ - return self.config_ptr.getNumSamples() - - def set_num_samples(self, num_samples: int) -> OutputSamplingWithoutReplacementConfig: - """ - Sets the number of outputs that should be included in a sample. - - :param num_samples: The number of outputs that should be included in a sample. Must be at least 1 - :return: An `OutputSamplingWithoutReplacementConfig` that allows further configuration of the - sampling method - """ - assert_greater_or_equal('num_samples', num_samples, 1) - self.config_ptr.setNumSamples(num_samples) - return self