29#include <pj/compat/high_precision.h>
48#define PJ_PI 3.14159265358979323846
50#define PJ_1_PI 0.318309886183790671538
56#define PJ_ABS(x) ((x) > 0 ? (x) : -(x))
59#define PJ_MAX(x, y) ((x) > (y)? (x) : (y))
62#define PJ_MIN(x, y) ((x) < (y)? (x) : (y))
76#if PJ_HAS_FLOATING_POINT
93 unsigned res = 1, prev;
105 res = (prev + i/prev) >> 1;
106 }
while ((prev+res)>>1 != res);
129#if PJ_HAS_FLOATING_POINT
143 stat->
min = stat->
max = val;
146#if PJ_HAS_FLOATING_POINT
147 delta = val - stat->fmean_;
148 stat->fmean_ += delta/stat->
n;
151 stat->
mean = (int) (stat->fmean_ + 0.5);
153 stat->
m2_ += (int)(delta * (val-stat->fmean_));
155 delta = val - stat->
mean;
156 stat->
mean += delta/stat->
n;
166 stat->
m2_ += delta * (val-stat->
mean);
179 if (stat->
n == 0)
return 0;
196 stat->
m2_ = dev*dev*stat->
n;
void pj_bzero(void *dst, pj_size_t size)
Definition: string.h:762
#define PJ_BEGIN_DECL
Definition: config.h:1284
#define PJ_INLINE(type)
Definition: config.h:1178
#define PJ_END_DECL
Definition: config.h:1285
void pj_math_stat_update(pj_math_stat *stat, int val)
Definition: math.h:127
void pj_math_stat_set_stddev(pj_math_stat *stat, unsigned dev)
Definition: math.h:192
void pj_math_stat_init(pj_math_stat *stat)
Definition: math.h:116
unsigned pj_isqrt(unsigned i)
Definition: math.h:91
unsigned pj_math_stat_get_stddev(const pj_math_stat *stat)
Definition: math.h:177
int min
Definition: math.h:71
pj_highprec_t m2_
Definition: math.h:81
int mean
Definition: math.h:73
int max
Definition: math.h:70
int mean_res_
Definition: math.h:79
int last
Definition: math.h:72
int n
Definition: math.h:69