internal

package
v0.1.0-rc4 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	C1 = 0x87c37b91114253d5
	C2 = 0x4cf5ad432745937f
)
View Source
const (
	JavaPath = "../serialization_test_data/java_generated_files"
	CppPath  = "../serialization_test_data/cpp_generated_files"
	GoPath   = "../serialization_test_data/go_generated_files"
)
View Source
const (
	DEFAULT_UPDATE_SEED = uint64(9001)
)
View Source
const (
	DSketchTestGenerateGo = "DSKETCH_TEST_GENERATE_GO"
)
View Source
const (
	InverseGolden = float64(0.6180339887498949025)
)

Variables

View Source
var FamilyEnum = &families{
	HLL: family{
		Id:          7,
		MaxPreLongs: 1,
	},
	Frequency: family{
		Id:          10,
		MaxPreLongs: 4,
	},
	Kll: family{
		Id:          15,
		MaxPreLongs: 2,
	},
	CPC: family{
		Id:          16,
		MaxPreLongs: 5,
	},
	CountMinSketch: family{
		Id:          18,
		MaxPreLongs: 3,
	},
	BloomFilter: family{
		Id:          21,
		MaxPreLongs: 4,
	},
	Tuple: family{
		Id:          9,
		MaxPreLongs: 3,
	},
	Theta: family{
		Id:          3,
		MaxPreLongs: 3,
	},
	TDigest: family{
		Id:          20,
		MaxPreLongs: 2,
	},
	ReservoirItems: family{
		Id:          11,
		MaxPreLongs: 2,
	},
	VarOptItems: family{
		Id:          13,
		MaxPreLongs: 4,
	},
	ReservoirUnion: family{
		Id:          12,
		MaxPreLongs: 1,
	},
}

Functions

func BoolToInt

func BoolToInt(b bool) int

func CeilPowerOf2

func CeilPowerOf2(n int) int

CeilPowerOf2 returns the smallest power of 2 greater than or equal to n.

func ComputeSeedHash

func ComputeSeedHash(seed int64) (int16, error)

func ExactLog2

func ExactLog2(powerOf2 int) (int, error)

func FindWithInequality

func FindWithInequality[C comparable](arr []C, low int, high int, v C, crit Inequality, comparator common.CompareFn[C]) int

func FloorPowerOf2

func FloorPowerOf2(n int64) int64

func GetShortLE

func GetShortLE(array []byte, offset int) int

GetShortLE gets a short value from a byte array in little endian format.

func HashByteArrMurmur3

func HashByteArrMurmur3(key []byte, offsetBytes int, lengthBytes int, seed uint64) (uint64, uint64)

func HashCharSliceMurmur3

func HashCharSliceMurmur3(key []byte, offsetChars int, lengthChars int, seed uint64) (uint64, uint64)

func HashInt32SliceMurmur3

func HashInt32SliceMurmur3(key []int32, offsetInts int, lengthInts int, seed uint64) (uint64, uint64)

func HashInt64SliceMurmur3

func HashInt64SliceMurmur3(key []int64, offsetLongs int, lengthLongs int, seed uint64) (uint64, uint64)

func InvPow2

func InvPow2(e int) (float64, error)

InvPow2 returns 2^(-e).

func IsNil

func IsNil[T any](t T) bool

func IsPowerOf2

func IsPowerOf2(powerOf2 int) bool

IsPowerOf2 returns true if the given number is a power of 2.

func LgSizeFromCount

func LgSizeFromCount(n uint32, loadFactor float64) uint8

func Log2Floor

func Log2Floor(n uint32) uint8

func PutShortLE

func PutShortLE(array []byte, offset int, value int)

PutShortLE puts a short value into a byte array in little endian format.

func QuickSelect

func QuickSelect[T cmp.Ordered](arr []T, lo int, hi int, pivot int) T

func QuickSelectFunc

func QuickSelectFunc[T any](arr []T, lo int, hi int, pivot int, compare func(a, b T) int) T

QuickSelectFunc finds the k-th smallest element in a slice using the Quickselect algorithm with a custom comparator. The slice is partially partitioned and may not maintain full order. It modifies the input slice in-place. T is a generic type, and the comparison logic is provided by the `compare` function. The `lo` and `hi` parameters define the range in the slice to consider for the selection.

Types

type Inequality

type Inequality int64
const (
	InequalityLT Inequality = iota
	InequalityLE
	InequalityGE
	InequalityGT
)

type SimpleMurmur3

type SimpleMurmur3 struct {
	// contains filtered or unexported fields
}

Directories

Path Synopsis
Package binomialproportionsbounds computes an approximation to the Clopper-Pearson confidence interval for a binomial proportion.
Package binomialproportionsbounds computes an approximation to the Clopper-Pearson confidence interval for a binomial proportion.

Jump to

Keyboard shortcuts

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