module
Depth::Stats::Quantize
Defined in:
depth/stats/quantize.crClass Method Summary
-
.gen_quantized(quants : Array(Int32), coverage : Array(Int32), limit : Int32, & : Tuple(Int32, Int32, String) -> )
Generate quantized depth segments limit: number of elements from coverage to consider (typically target_size) Yields tuples of (start, stop, label) over [0, limit-1]
-
.gen_quantized(quants : Array(Int32), coverage : Array(Int32), &block : Tuple(Int32, Int32, String) -> )
Backward-compatible overload: consume entire coverage array
-
.get_quantize_args(qa : String) : Array(Int32)
Parse quantize arguments string into array of integers Examples: ":1" -> [0, 1] "0:1:4:" -> [0, 1, 4, Int32::MAX]
-
.linear_search(q : Int32, vals : Array(Int32)) : Int32
Linear search to find which bin a value belongs to Returns -1 if value is outside all bins
-
.make_lookup(quants : Array(Int32)) : Array(String)
Create lookup table for quantize bins Examples: [0, 1, 4] -> ["0:1", "1:4", "4:inf"]
Class Method Detail
Generate quantized depth segments limit: number of elements from coverage to consider (typically target_size) Yields tuples of (start, stop, label) over [0, limit-1]
Backward-compatible overload: consume entire coverage array
Parse quantize arguments string into array of integers Examples: ":1" -> [0, 1] "0:1:4:" -> [0, 1, 4, Int32::MAX]
Linear search to find which bin a value belongs to Returns -1 if value is outside all bins
Create lookup table for quantize bins Examples: [0, 1, 4] -> ["0:1", "1:4", "4:inf"]