Skip to content
Snippets Groups Projects
Commit a5658f30 authored by Pospelov, Gennady's avatar Pospelov, Gennady
Browse files

Cleanup in IntensityFunctions

parent 86ddd138
No related branches found
No related tags found
No related merge requests found
...@@ -16,12 +16,19 @@ ...@@ -16,12 +16,19 @@
#include <cmath> #include <cmath>
#include <limits> #include <limits>
IIntensityFunction::~IIntensityFunction() = default;
IntensityFunctionLog* IntensityFunctionLog::clone() const { return new IntensityFunctionLog; }
double IntensityFunctionLog::evaluate(double value) const double IntensityFunctionLog::evaluate(double value) const
{ {
return value > 0 ? std::log(value) : std::numeric_limits<double>::lowest(); return value > 0 ? std::log(value) : std::numeric_limits<double>::lowest();
} }
IntensityFunctionSqrt* IntensityFunctionSqrt::clone() const { return new IntensityFunctionSqrt; }
double IntensityFunctionSqrt::evaluate(double value) const double IntensityFunctionSqrt::evaluate(double value) const
{ {
return value > 0 ? std::sqrt(value) : std::numeric_limits<double>::lowest(); return value > 0 ? std::sqrt(value) : std::numeric_limits<double>::lowest();
} }
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
class BA_CORE_API_ IIntensityFunction class BA_CORE_API_ IIntensityFunction
{ {
public: public:
virtual ~IIntensityFunction() {} virtual ~IIntensityFunction();
virtual IIntensityFunction *clone() const =0; virtual IIntensityFunction *clone() const =0;
virtual double evaluate(double value) const =0; virtual double evaluate(double value) const =0;
}; };
...@@ -36,8 +36,7 @@ public: ...@@ -36,8 +36,7 @@ public:
class BA_CORE_API_ IntensityFunctionLog : public IIntensityFunction class BA_CORE_API_ IntensityFunctionLog : public IIntensityFunction
{ {
public: public:
virtual ~IntensityFunctionLog() {} virtual IntensityFunctionLog *clone() const;
virtual IntensityFunctionLog *clone() const { return new IntensityFunctionLog(); }
virtual double evaluate(double value) const; virtual double evaluate(double value) const;
}; };
...@@ -48,8 +47,7 @@ public: ...@@ -48,8 +47,7 @@ public:
class BA_CORE_API_ IntensityFunctionSqrt : public IIntensityFunction class BA_CORE_API_ IntensityFunctionSqrt : public IIntensityFunction
{ {
public: public:
virtual ~IntensityFunctionSqrt() {} virtual IntensityFunctionSqrt *clone() const;
virtual IntensityFunctionSqrt *clone() const { return new IntensityFunctionSqrt(); }
virtual double evaluate(double value) const; virtual double evaluate(double value) const;
}; };
......
...@@ -12,8 +12,8 @@ ...@@ -12,8 +12,8 @@
// //
// ************************************************************************** // // ************************************************************************** //
#ifndef IVARIANCEFUNCTION_H #ifndef VARIANCEFUNCTIONS_H
#define IVARIANCEFUNCTION_H #define VARIANCEFUNCTIONS_H
#include "WinDllMacros.h" #include "WinDllMacros.h"
...@@ -56,4 +56,4 @@ private: ...@@ -56,4 +56,4 @@ private:
double m_epsilon; double m_epsilon;
}; };
#endif // IVARIANCEFUNCTION_H #endif // VARIANCEFUNCTIONS_H
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment