module Depth::Stats::Quantize

Defined in:

depth/stats/quantize.cr

Class Method Summary

Class Method Detail

def self.gen_quantized(quants : Array(Int64), coverage : Array(Int32), limit : Int32, & : Tuple(Int32, Int32, String) -> ) #

def self.gen_quantized(quants : Array(Int64), coverage : Array(Int32), &block : Tuple(Int32, Int32, String) -> ) #

Backward-compatible overload: consume entire coverage array


def self.get_quantize_args(qa : String) : Array(Int64) #

Parse quantize arguments string into array of integers Examples: ":1" -> [0, 1] "0:1:4:" -> [0, 1, 4, Int64::MAX] (the final value represents infinity)


def self.linear_search(q : Int32 | Int64, vals : Array(Int64)) : Int32 #

Linear search to find which bin a value belongs to Returns -1 if value is outside all bins


def self.make_lookup(quants : Array(Int64)) : Array(String) #

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