histutil

package
v0.0.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2026 License: MIT Imports: 0 Imported by: 0

Documentation

Overview

Package histutil 提供按 edges 参数化的直方图槽定位与分位数插值。 各领域包(durhist/ttfthist/tpshist)持有自己的 Edges,逻辑在此一处实现。

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EstimatePercentile

func EstimatePercentile(edges []int64, counts []int64, p float64, maxVal int64) int64

EstimatePercentile 在合并直方图上求近似分位(p ∈ (0,1))。counts 长度须 = len(edges)+1。

func MergeCounts

func MergeCounts(rows [][]int64) []int64

MergeCounts merges histogram rows slot by slot. Rows may be empty or have different widths; the result preserves every provided slot without panic.

func SlotIndex

func SlotIndex(edges []int64, v int64) int

SlotIndex 返回 v 落入的槽下标(槽 i 覆盖 [edges[i-1], edges[i]),槽 0 下界 0,末槽为溢出槽)。

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL