skip to content
[readonly]
==> include/hist_quantile.h <==
1/* @ajax/hist-quantile: The per-mille quantile of a histogram of unit bins.
2 *
3 * Part of alpha-c-mesh, a C port of alpha-rust-mesh (README.md says from where). */
4#ifndef HIST_QUANTILE_H
5#define HIST_QUANTILE_H
6
7#include <stdbool.h>
8#include <stddef.h>
9#include <stdint.h>
10
11/* The quantile per_mille/1000 of a histogram of n bins (bin i counts values
12 * of i units): the first bin at which the running count reaches
13 * ceil(total x per_mille / 1000) (at least 1); 0 for an empty histogram. */
14uint32_t hist_quantile(const uint32_t *hist, size_t n, uint64_t per_mille);
15
16#endif