From b279ba9a40d1c9dde6fbda38a9f540e7fc5899e1 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Sun, 29 Jun 2025 18:45:55 -0400 Subject: [PATCH] follow one definition rule by moving functions into class definition --- src/ML-RANN/rann_activation.h | 40 +++++++++-------------------------- 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/src/ML-RANN/rann_activation.h b/src/ML-RANN/rann_activation.h index b4af460319..5f1c8ce752 100644 --- a/src/ML-RANN/rann_activation.h +++ b/src/ML-RANN/rann_activation.h @@ -35,39 +35,19 @@ namespace LAMMPS_NS { namespace RANN { class Activation { public: - Activation(class PairRANN *); - virtual ~Activation(); - virtual double activation_function(double); - virtual double dactivation_function(double); - virtual double ddactivation_function(double); + Activation(class PairRANN *) + { + empty = true; + style = "empty"; + } + virtual ~Activation() = default; + //default is linear activation (no change). + virtual double activation_function(double A) { return A; }; + virtual double dactivation_function(double) { return 1.0; }; + virtual double ddactivation_function(double) { return 0.0; }; bool empty; const char *style; }; - - Activation::Activation(PairRANN *) - { - empty = true; - style = "empty"; - } - - Activation::~Activation() {} - - //default is linear activation (no change). - double Activation::activation_function(double A) - { - return A; - } - - double Activation::dactivation_function(double) - { - return 1.0; - } - - double Activation::ddactivation_function(double) - { - return 0.0; - } } // namespace RANN } // namespace LAMMPS_NS - #endif /* RANN_ACTIVATION_H_ */