Go to the documentation of this file. 1 #ifndef BENCHMARK_STAT_H_
2 #define BENCHMARK_STAT_H_
11 template <
typename VType,
typename NumType>
14 template <
typename VType,
typename NumType>
22 template <
typename VType>
24 template <
typename VType>
26 template <
typename VType>
29 template <
typename VType,
typename NumType>
36 explicit Stat1(
const VType &dat) {
50 Stat1(
const VType &dat,
const NumType &
w) {
118 VType
Mean(VType *stddev)
const {
135 VType stddev = VType();
143 "NumType must be an integral type that is not bool.");
153 template <
typename SType>
154 static inline SType
Sqr(
const SType &dat) {
158 template <
typename SType>
160 return dat.MulComponents(dat);
163 template <
typename SType>
165 return dat.MulComponents(dat);
168 template <
typename SType>
170 return dat.MulComponents(dat);
175 template <
typename SType>
176 static inline SType
Sqrt(
const SType &dat) {
178 if (dat < 0)
return 0;
182 template <
typename SType>
188 template <
typename SType>
194 template <
typename SType>
202 template <
typename VType,
typename NumType>
204 out <<
"{ avg = " <<
s.Mean() <<
" std = " <<
s.StdDev()
205 <<
" nsamples = " <<
s.NumSamples() <<
"}";
213 template <
typename VType,
typename NumType>
214 class Stat1MinMax :
public Stat1<VType, NumType> {
234 :
Stat1<VType, NumType>(dat,
w) {
246 if (std::numeric_limits<VType>::has_infinity) {
247 min_ = std::numeric_limits<VType>::infinity();
248 max_ = -std::numeric_limits<VType>::infinity();
250 min_ = std::numeric_limits<VType>::max();
251 max_ = std::numeric_limits<VType>::min();
300 template <
typename VType,
typename NumType>
303 out <<
"{ avg = " <<
s.Mean() <<
" std = " <<
s.StdDev()
304 <<
" nsamples = " <<
s.NumSamples() <<
" min = " <<
s.Min()
305 <<
" max = " <<
s.Max() <<
"}";
310 #endif // BENCHMARK_STAT_H_
static Vector4< SType > Sqrt(const Vector4< SType > &dat)
NumType numSamples() const
Self operator*(const VType &k) const
static Vector2< SType > Sqr(const Vector2< SType > &dat)
Self operator+(const Self &stat) const
Self operator*(const VType &k) const
Stat1(const VType &dat, const NumType &w)
Self operator-(const Self &stat) const
static Vector3< SType > Sqr(const Vector3< SType > &dat)
Stat1MinMax(const VType &dat, const NumType &w)
static Vector2< SType > Sqrt(const Vector2< SType > &dat)
Stat1< VType, NumType > Self
Stat1MinMax(const VType *begin, const VType *end)
Stat1MinMax< double, int64_t > Stat1MinMax_d
Self & operator-=(const Self &stat)
static size_t begin(const upb_table *t)
static Vector4< SType > Sqr(const Vector4< SType > &dat)
Stat1< double, int64_t > Stat1_d
Stat1< float, int64_t > Stat1_f
Self & operator+=(const Self &stat)
Self & operator-=(const Self &stat)
Self & operator*=(const VType &k)
Stat1MinMax(const Self &stat)
VType Mean(VType *stddev) const
Self operator+(const Self &stat) const
Stat1MinMax< VType, NumType > Self
static SType Sqrt(const SType &dat)
Self operator-(const Self &stat) const
Self & operator+=(const Self &stat)
Stat1MinMax< float, int64_t > Stat1MinMax_f
static SType Sqr(const SType &dat)
Stat1MinMax(const VType &dat)
Self & operator=(const Self &stat)
Self & operator=(const Self &stat)
static Vector3< SType > Sqrt(const Vector3< SType > &dat)
Self & operator*=(const VType &stat)
std::ostream & operator<<(std::ostream &out, const Stat1< VType, NumType > &s)
GLsizei const GLfloat * value
GLubyte GLubyte GLubyte GLubyte w
Stat1(const VType *begin, const VType *end)
libaditof
Author(s):
autogenerated on Wed May 21 2025 02:06:58