#include #include #include namespace Statistics { template StatsContainer; template StatsContainer; template StatsContainer; template StatsContainer; //-------------------------------------------------------------------- //-------------------------------------------------------------------- template StatsContainer::StatsContainer(const StatsContainer& s) { this->defined = s.defined; this->mean = s.mean; this->stddev = s.stddev; this->median = s.median; this->madfm = s.madfm; this->threshold = s.threshold; this->pThreshold = s.pThreshold; this->useRobust = s.useRobust; this->useFDR = s.useFDR; } template StatsContainer::StatsContainer(const StatsContainer& s); template StatsContainer::StatsContainer(const StatsContainer& s); template StatsContainer::StatsContainer(const StatsContainer& s); template StatsContainer::StatsContainer(const StatsContainer& s); //-------------------------------------------------------------------- template StatsContainer& StatsContainer::operator= (const StatsContainer& s) { this->defined = s.defined; this->mean = s.mean; this->stddev = s.stddev; this->median = s.median; this->madfm = s.madfm; this->threshold = s.threshold; this->pThreshold = s.pThreshold; this->useRobust = s.useRobust; this->useFDR = s.useFDR; } template StatsContainer& StatsContainer::operator= (const StatsContainer& s); template StatsContainer& StatsContainer::operator= (const StatsContainer& s); template StatsContainer& StatsContainer::operator= (const StatsContainer& s); template StatsContainer& StatsContainer::operator= (const StatsContainer& s); //-------------------------------------------------------------------- template void StatsContainer::calculate(Type *array, long size) { /** * Calculate all four statistics for all elements of a given * array. * * \param array The input data array. * \param size The length of the input array */ findNormalStats(array, size, this->mean, this->stddev); findMedianStats(array, size, this->median, this->madfm); this->defined = true; } template void StatsContainer::calculate(int *array, long size); template void StatsContainer::calculate(long *array, long size); template void StatsContainer::calculate(float *array, long size); template void StatsContainer::calculate(double *array, long size); //-------------------------------------------------------------------- template void StatsContainer::calculate(Type *array, long size, bool *isGood) { /** * Calculate all four statistics for a subset of a given * array. The subset is defined by an array of bool * variables. * * \param array The input data array. * \param size The length of the input array * \param isGood An array of the same length that says whether to * include each member of the array in the calculations. */ findNormalStats(array, size, isGood, this->mean, this->stddev); findMedianStats(array, size, isGood, this->median, this->madfm); this->defined = true; } template void StatsContainer::calculate(int *array, long size, bool *isGood); template void StatsContainer::calculate(long *array, long size, bool *isGood); template void StatsContainer::calculate(float *array, long size, bool *isGood); template void StatsContainer::calculate(double *array, long size, bool *isGood); //-------------------------------------------------------------------- template std::ostream& operator<< (std::ostream& theStream, StatsContainer &s) { /** * Prints out the four key statistics to the requested stream. */ theStream << "Mean = " << s.mean << "\t" << "Std.Dev. = " << s.stddev << "\n" << "Median = " << s.median << "\t" << "MADFM = " << s.madfm << "\n"; } template std::ostream& operator<< (std::ostream& theStream, StatsContainer &s); template std::ostream& operator<< (std::ostream& theStream, StatsContainer &s); template std::ostream& operator<< (std::ostream& theStream, StatsContainer &s); template std::ostream& operator<< (std::ostream& theStream, StatsContainer &s); } // matches: namespace Statistics {