follow one definition rule by moving functions into class definition
This commit is contained in:
@ -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_ */
|
||||
|
||||
Reference in New Issue
Block a user