follow one definition rule by moving functions into class definition

This commit is contained in:
Axel Kohlmeyer
2025-06-29 18:45:55 -04:00
parent 3e12c3f773
commit b279ba9a40

View File

@ -35,39 +35,19 @@ namespace LAMMPS_NS {
namespace RANN { namespace RANN {
class Activation { class Activation {
public: public:
Activation(class PairRANN *); Activation(class PairRANN *)
virtual ~Activation(); {
virtual double activation_function(double); empty = true;
virtual double dactivation_function(double); style = "empty";
virtual double ddactivation_function(double); }
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; bool empty;
const char *style; 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 RANN
} // namespace LAMMPS_NS } // namespace LAMMPS_NS
#endif /* RANN_ACTIVATION_H_ */ #endif /* RANN_ACTIVATION_H_ */