radixselector

package
v0.0.0-...-53ff736 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (

	// LEVEL_THRESHOLD after that many levels of recursion we fall back to introselect anyway
	// this is used as a protection against the fact that radix sort performs
	// worse when there are long common prefixes (probably because of cache
	// locality)
	LEVEL_THRESHOLD = 8

	// HISTOGRAM_SIZE size of histograms: 256 + 1 to indicate that the string is finished
	HISTOGRAM_SIZE = 257

	// LENGTH_THRESHOLD buckets below this size will be sorted with introselect
	LENGTH_THRESHOLD = 100
)

Variables

This section is empty.

Functions

func NewRadixSelector

func NewRadixSelector(cfg *RadixSelectorConfig) util.Selector

NewRadixSelector Sole constructor. Params: maxLength – the maximum length of keys, pass Integer.MAX_VALUE if unknown.

Types

type Option

type Option func(*option)

func WithByteAtFunc

func WithByteAtFunc(fn func(i, k int) int) Option

func WithGetFallbackSelectorFunc

func WithGetFallbackSelectorFunc(fn func(d int) util.Selector) Option

func WithMaxLength

func WithMaxLength(size int) Option

func WithSwapFunc

func WithSwapFunc(fn func(i, j int)) Option

type RadixSelectorConfig

type RadixSelectorConfig struct {
	MaxLength             int
	FnByteAt              func(i, k int) int
	FnSwap                func(i, j int)
	FnGetFallbackSelector func(d int) util.Selector
}

Jump to

Keyboard shortcuts

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