allot

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 7, 2025 License: MIT Imports: 1 Imported by: 0

Documentation

Overview

Package allot contains the precalculated bitsets of all baseIndices, which for a given prefix contain all longer prefixes covered by it.

Please read the ART paper ./doc/artlookup.pdf to understand the baseIndex algorithm.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IdxToFringeRoutes

func IdxToFringeRoutes(idx uint8) *bitset.BitSet256

IdxToFringeRoutes as precalculated bitsets,

Map the baseIndex to a bitset as a precomputed complete binary tree.

  // 1 <= idx <= 511
	func allotRec(aTbl *bitset.BitSet, idx uint) {
		aTbl = aTbl.Set(idx)
		if idx > 255 {
			return
		}
		allotRec(aTbl, idx<<1)
		allotRec(aTbl, idx<<1+1)
	}

Only used for fast bitset intersections instead of range loops in table overlaps methods.

func IdxToPrefixRoutes

func IdxToPrefixRoutes(idx uint8) *bitset.BitSet256

IdxToPrefixRoutes as precalculated bitsets,

Map the baseIndex to a bitset as a precomputed complete binary tree.

  // 1 <= idx <= 511
	func allotRec(aTbl *bitset.BitSet, idx uint) {
		aTbl = aTbl.Set(idx)
		if idx > 255 {
			return
		}
		allotRec(aTbl, idx<<1)
		allotRec(aTbl, idx<<1+1)
	}

Only used for fast bitset intersections instead of range loops in table overlaps methods.

Types

This section is empty.

Jump to

Keyboard shortcuts

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