From 01048963ddffd8180a9305f999f15da04355b873 Mon Sep 17 00:00:00 2001 From: petersalemink95 Date: Tue, 4 Jun 2024 12:33:35 +0200 Subject: [PATCH] revert weird changes Signed-off-by: petersalemink95 --- .../power_grid_model/component/transformer.hpp | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/power_grid_model_c/power_grid_model/include/power_grid_model/component/transformer.hpp b/power_grid_model_c/power_grid_model/include/power_grid_model/component/transformer.hpp index f3357ebe2..ab5d36191 100644 --- a/power_grid_model_c/power_grid_model/include/power_grid_model/component/transformer.hpp +++ b/power_grid_model_c/power_grid_model/include/power_grid_model/component/transformer.hpp @@ -73,14 +73,14 @@ class Transformer : public Branch { double phase_shift() const final { return clock_ * deg_30; } bool is_param_mutable() const final { return true; } // getters - IntS tap_pos() const { return tap_pos_; } - BranchSide tap_side() const { return tap_side_; } - IntS tap_min() const { return tap_min_; } - IntS tap_max() const { return tap_max_; } - IntS tap_nom() const { return tap_nom_; } + constexpr IntS tap_pos() const { return tap_pos_; } + constexpr BranchSide tap_side() const { return tap_side_; } + constexpr IntS tap_min() const { return tap_min_; } + constexpr IntS tap_max() const { return tap_max_; } + constexpr IntS tap_nom() const { return tap_nom_; } // setter - bool set_tap(IntS new_tap) { + constexpr bool set_tap(IntS new_tap) { if (new_tap == na_IntS || new_tap == tap_pos_) { return false; } @@ -144,7 +144,7 @@ class Transformer : public Branch { return {r / base_z, x / base_z}; } - IntS tap_limit(IntS new_tap) const { + constexpr IntS tap_limit(IntS new_tap) const { new_tap = std::min(new_tap, std::max(tap_max_, tap_min_)); new_tap = std::max(new_tap, std::min(tap_max_, tap_min_)); return new_tap; @@ -267,4 +267,6 @@ class Transformer : public Branch { } }; +static_assert(transformer_c); + } // namespace power_grid_model