15 #ifndef __IPSDKMATH_BASICSTATISTICS_H__ 16 #define __IPSDKMATH_BASICSTATISTICS_H__ 33 template <
typename IteratorType>
36 const IteratorType& iterEnd,
37 typename std::iterator_traits<IteratorType>::value_type& minValue,
38 typename std::iterator_traits<IteratorType>::value_type& maxValue)
41 typedef typename std::iterator_traits<IteratorType>::value_type T;
46 IteratorType iter = iterBegin;
47 while (iter != iterEnd) {
57 template <
typename ContainerType>
60 typename ContainerType::value_type& minValue,
61 typename ContainerType::value_type& maxValue)
81 std::nth_element(coll.begin(),
82 coll.begin() + size / 2,
85 return coll[size / 2];
91 mean(
const std::vector<T>& coll);
96 variance(
const std::vector<T>& coll);
101 stdDev(
const std::vector<T>& coll);
104 template <
typename T>
114 template <
typename T>
116 correlation(
const std::vector<T>& coll1,
const std::vector<T>& coll2);
124 #endif // __IPSDKMATH_BASICSTATISTICS_H__ IPSDKMATH_API ipReal64 stdDev(const std::vector< T > &coll)
function allowing to compute standard deviation for a vector
Definition of import/export macro for library.
Main namespace for IPSDK library.
Definition: AlgorithmFunctionEfficiency.h:22
void extractMinMax(const IteratorType &iterBegin, const IteratorType &iterEnd, typename std::iterator_traits< IteratorType >::value_type &minValue, typename std::iterator_traits< IteratorType >::value_type &maxValue)
function allowing to compute minimum and maximum value for a collection
Definition: BasicStatistics.h:35
IPSDKMATH_API std::pair< ipReal64, ipReal64 > meanAndVariance(const std::vector< T > &coll)
function allowing to compute mean and variance for a vector
T median(std::vector< T > &coll)
function allowing to compute median of a collection
Definition: BasicStatistics.h:73
IPSDKMATH_API ipReal64 mean(const std::vector< T > &coll)
function allowing to compute mean for a vector
double ipReal64
Base types definition.
Definition: BaseTypes.h:57
Definition: NumericLimits.h:27
Base types for multiplatform compatibility.
#define IPSDKMATH_API
Import/Export macro for library IPSDKMath.
Definition: IPSDKMathExports.h:27
IPSDKMATH_API ipReal64 correlation(const std::vector< T > &coll1, const std::vector< T > &coll2)
function allowing to compute correlation between two vectors of data
IPSDKMATH_API ipReal64 variance(const std::vector< T > &coll)
function allowing to compute variance for a vector
uint32_t ipUInt32
Base types definition.
Definition: BaseTypes.h:53