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);
virtual double dactivation_function(double);
virtual double ddactivation_function(double);
bool empty;
const char *style;
};
Activation::Activation(PairRANN *)
{ {
empty = true; empty = true;
style = "empty"; style = "empty";
} }
virtual ~Activation() = default;
Activation::~Activation() {}
//default is linear activation (no change). //default is linear activation (no change).
double Activation::activation_function(double A) virtual double activation_function(double A) { return A; };
{ virtual double dactivation_function(double) { return 1.0; };
return A; virtual double ddactivation_function(double) { return 0.0; };
} bool empty;
const char *style;
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_ */