module Depth::Stats::Quantize

Defined in:

depth/stats/quantize.cr

Class Method Summary

Class Method Detail

def self.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]


[View source]
def self.gen_quantized(quants : Array(Int32), coverage : Array(Int32), &block : Tuple(Int32, Int32, String) -> ) #

Backward-compatible overload: consume entire coverage array


[View source]
def self.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]


[View source]
def self.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


[View source]
def self.make_lookup(quants : Array(Int32)) : Array(String) #

Create lookup table for quantize bins Examples: [0, 1, 4] -> ["0:1", "1:4", "4:inf"]


[View source]