|
#define | PJ_PI 3.14159265358979323846 /* pi */ |
|
#define | PJ_1_PI 0.318309886183790671538 /* 1/pi */ |
|
#define | PJ_ABS(x) ((x) > 0 ? (x) : -(x)) |
|
#define | PJ_MAX(x, y) ((x) > (y)? (x) : (y)) |
|
#define | PJ_MIN(x, y) ((x) < (y)? (x) : (y)) |
|
Provides common mathematics constants and operations, and also standard statistics calculation (min, max, mean, standard deviation). Statistics calculation is done in realtime (statistics state is updated on time each new sample comes).
◆ PJ_ABS
#define PJ_ABS |
( |
|
x | ) |
((x) > 0 ? (x) : -(x)) |
◆ PJ_PI
#define PJ_PI 3.14159265358979323846 /* pi */ |
◆ pj_isqrt()
unsigned pj_isqrt |
( |
unsigned |
i | ) |
|
Calculate integer square root of an integer.
- Parameters
-
i | Integer to be calculated. |
- Returns
- Square root result.
Referenced by pj_math_stat_get_stddev().
◆ pj_math_stat_get_stddev()
unsigned pj_math_stat_get_stddev |
( |
const pj_math_stat * |
stat | ) |
|
Get the standard deviation of specified statistics state.
- Parameters
-
- Returns
- The standard deviation.
References pj_isqrt().
◆ pj_math_stat_init()
Initialize statistics state.
- Parameters
-
References pj_bzero().
◆ pj_math_stat_set_stddev()
void pj_math_stat_set_stddev |
( |
pj_math_stat * |
stat, |
|
|
unsigned |
dev |
|
) |
| |
Set the standard deviation of statistics state. This is useful when the statistic state is operated in 'read-only' mode as a storage of statistical data.
- Parameters
-
stat | Statistic state. |
dev | The standard deviation. |
References PJ_END_DECL.
◆ pj_math_stat_update()
Update statistics state as a new sample comes.
- Parameters
-
stat | Statistic state. |
val | The new sample data. |
References int().