Commit 1273420e authored by Gigg, Martyn Anthony's avatar Gigg, Martyn Anthony
Browse files

Formatting changes. Refs #5629

parent 43c301a6
#ifndef STATISTICS_H_ #ifndef MANTID_KERNEL_STATISTICS_H_
#define STATISTICS_H_ #define MANTID_KERNEL_STATISTICS_H_
#include <vector>
#include "MantidKernel/DllConfig.h" #include "MantidKernel/DllConfig.h"
#include <vector>
namespace Mantid namespace Mantid
{ {
namespace Kernel namespace Kernel
{ {
/**
Simple struct to store statistics.
Copyright &copy; 2010-2012 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory
struct Statistics This file is part of Mantid.
{
/// Minimum value Mantid is free software; you can redistribute it and/or modify
double minimum; it under the terms of the GNU General Public License as published by
/// Maximum value the Free Software Foundation; either version 3 of the License, or
double maximum; (at your option) any later version.
/// Mean value
double mean; Mantid is distributed in the hope that it will be useful,
/// Median value but WITHOUT ANY WARRANTY; without even the implied warranty of
double median; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
/// standard_deviation of the values GNU General Public License for more details.
double standard_deviation;
};
template<typename TYPE> You should have received a copy of the GNU General Public License
Statistics getStatistics(const std::vector<TYPE>& data, const bool sorted=false); along with this program. If not, see <http://www.gnu.org/licenses/>.
template<typename TYPE>
std::vector<double> getZscore(const std::vector<TYPE>& data, const bool sorted=false);
template<typename TYPE>
std::vector<double> getModifiedZscore(const std::vector<TYPE>& data, const bool sorted=false);
} // namespace Kernel File change history is stored at: <https://svn.mantidproject.org/mantid/trunk/Code/Mantid>.
Code Documentation is available at: <http://doxygen.mantidproject.org>
*/
struct Statistics
{
/// Minimum value
double minimum;
/// Maximum value
double maximum;
/// Mean value
double mean;
/// Median value
double median;
/// standard_deviation of the values
double standard_deviation;
};
/// Return a statistics object for the given data set
template<typename TYPE>
Statistics getStatistics(const std::vector<TYPE>& data, const bool sorted=false);
/// Return the Z score values for a dataset
template<typename TYPE>
std::vector<double> getZscore(const std::vector<TYPE>& data, const bool sorted=false);
/// Return the modified Z score values for a dataset
template<typename TYPE>
std::vector<double> getModifiedZscore(const std::vector<TYPE>& data, const bool sorted=false);
} // namespace Kernel
} // namespace Mantid } // namespace Mantid
#endif /* STATISTICS_H_ */ #endif /* STATISTICS_H_ */
// Includes
#include "MantidKernel/Statistics.h"
#include <algorithm> #include <algorithm>
#include <functional> #include <functional>
#include <limits> #include <limits>
#include <math.h> #include <cmath>
#include <numeric> #include <numeric>
#include <string> #include <string>
#include <iostream>
#include "MantidKernel/Statistics.h"
namespace Mantid namespace Mantid
{ {
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment