Newer
Older
Martin Beseda
committed
//
// Created by martin on 21.11.18.
//
#ifndef LIB4NEURO_NORMALIZATIONSTRATEGY_H
#define LIB4NEURO_NORMALIZATIONSTRATEGY_H
#include <limits>
/**
*
*/
Martin Beseda
committed
class NormalizationStrategy {
protected:
/**
*
*/
double max_value = std::numeric_limits<double>::quiet_NaN();
/**
*
*/
double min_value = std::numeric_limits<double>::quiet_NaN();
Martin Beseda
committed
public:
/**
*
*/
struct access;
/**
*
* @param n
* @param max
* @param min
* @return
*/
Martin Beseda
committed
virtual double normalize(double n, double max, double min) = 0;
/**
*
* @param n
* @param max
* @param min
* @return
*/
virtual double de_normalize(double n) = 0;
/**
*
* @return
*/
double get_max_value();
/**
*
* @return
*/
double get_min_value();
Martin Beseda
committed
};
/**
*
*/
Martin Beseda
committed
class DoubleUnitStrategy : public NormalizationStrategy {
public:
/**
*
*/
struct access;
/**
*
*/
Martin Beseda
committed
DoubleUnitStrategy();
/**
* Normalizes the input value to the interval [-1,1]
*
* @param n
* @param max
* @param min
* @return
*/
double normalize(double n, double max, double min) override;
/**
*
* @param n
* @return
*/
double de_normalize(double n) override;
Martin Beseda
committed
};
#endif //LIB4NEURO_NORMALIZATIONSTRATEGY_H