Documentation
¶
Index ¶
Constants ¶
View Source
const SplitMedian = 7 // makes 0 vs 1 ratio like [0..6] vs [7..15]
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HashFactoryFunc ¶
type MaterialAllocationCalculator ¶
type MaterialAllocationCalculator interface { AllocationOfLine(local reference.Local) jet.Prefix // AllocationOfJets MUST receive list of all jets, otherwise allocation may be incorrect. // This requirements for all jets is intended to support balanced distribution algorithms. AllocationOfJets([]jet.ExactID, pulse.Number) map[jet.ID]node.ShortNodeID }
type MaterialAllocationStrategy ¶
type MaterialAllocationStrategy interface {
CreateCalculator(entropy longbits.FixedReader, population census.OnlinePopulation) MaterialAllocationCalculator
}
func NewMaterialAllocationStrategy ¶
func NewMaterialAllocationStrategy(usePower bool) MaterialAllocationStrategy
type PrefixCalc ¶
Converts a byte sequence into a bit prefix for PrefixTree.
Must set OverlapOfs>0 when a structured header is present within a byte sequence. When OverlapOfs !=0, then the calculator will mix b[n]^b[n + OverlapOfs]
func NewPrefixCalc ¶
func NewPrefixCalc() PrefixCalc
Default prefix calculator, requires 12 bytes for 16 bit prefix and uses SplitMedian const for mis-balancing.
Recommended use:
bitPrefix := NewPrefixCalc().FromXXX(prefixTree.MaxDepth(), reference) or bitPrefix := NewPrefixCalc().FromXXX(16, reference) ... bitPrefix, bitPrefixLen = prefixTree.GetPrefix(bitPrefix)
func (PrefixCalc) FromReader ¶
Converts data[:OverlapOfs + (prefixLen)/2] into prefixLen bits.
Click to show internal directories.
Click to hide internal directories.