Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
mantidproject
mantid
Commits
1273420e
Commit
1273420e
authored
Jul 20, 2012
by
Gigg, Martyn Anthony
Browse files
Formatting changes. Refs #5629
parent
43c301a6
Changes
2
Hide whitespace changes
Inline
Side-by-side
Code/Mantid/Framework/Kernel/inc/MantidKernel/Statistics.h
View file @
1273420e
#ifndef STATISTICS_H_
#define STATISTICS_H_
#ifndef
MANTID_KERNEL_
STATISTICS_H_
#define
MANTID_KERNEL_
STATISTICS_H_
#include
<vector>
#include
"MantidKernel/DllConfig.h"
#include
<vector>
namespace
Mantid
{
namespace
Kernel
{
namespace
Kernel
{
/**
Simple struct to store statistics.
Copyright © 2010-2012 ISIS Rutherford Appleton Laboratory & NScD Oak Ridge National Laboratory
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
;
};
This file is part of Mantid.
Mantid is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
Mantid is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
template
<
typename
TYPE
>
Statistics
getStatistics
(
const
std
::
vector
<
TYPE
>&
data
,
const
bool
sorted
=
false
);
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
);
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
}
// 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
#endif
/* STATISTICS_H_ */
Code/Mantid/Framework/Kernel/src/Statistics.cpp
View file @
1273420e
// Includes
#include
"MantidKernel/Statistics.h"
#include
<algorithm>
#include
<functional>
#include
<limits>
#include
<math
.h
>
#include
<
c
math>
#include
<numeric>
#include
<string>
#include
<iostream>
#include
"MantidKernel/Statistics.h"
namespace
Mantid
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment