#ifndef _MeanEstimate_h_ #define _MeanEstimate_h_ #include "../Pattern/Singleton.h" #include #include #include #include #define VARIATION_COEF 0.02 class CDebugOutput : public Singleton< CDebugOutput > { public: void Init(); void OpenFile(); void WriteToFile(); std::map< int, double > m_diameter; std::map< int, double > m_estimate2; std::map< int, double > m_distensibility; std::map< int, double > m_distensibility20; FILE* m_file; int currentIndex; int m_minIndex; int m_maxIndex; protected: friend class Singleton< CDebugOutput >; CDebugOutput(); }; class CMeanEstimate { public: static bool IsANumber(double x); static void RemoveNanValues(std::vector *A); static void RemoveValues(std::vector *A, double value); static void RemoveOutOfBoundsValues(std::vector *A, double percent);//precent : Bounds are the means +/- percent of the mean static void FindMinMax(std::vector *A, double &min, double &max); static void FindMinMaxWithinBoundsValues(std::vector *A, double percent, double &min, double &max); static double GetVariance(std::vector *A); static double GetStandardDeviation(std::vector *A); static double GetMean(std::vector *A); static double GetMeanEstimate(std::vector *A, double similarityCoef); static double GetMeanEstimate(std::vector *A); static double GetMeanEstimateFileOutput(std::vector *A, double similarityCoef=VARIATION_COEF); static void writeFileOutput(char* text); static void endFileOutput(); static void PrintMeanEstimate(std::vector *A, std::vector *B); static void PrintMeanEstimate(std::vector *A, std::vector *B, double similarityCoef); static void startFileOutput(char *filename); static void titleFileOutput(char *title, std::vector *A, std::vector *B); static void titleFileOutput(std::vector *A); //static void OutputToFile(char* filename, std::vector *A, std::vector