Documentation
¶
Index ¶
- Constants
- Variables
- func BoolToInt(b bool) int
- func CeilPowerOf2(n int) int
- func ComputeSeedHash(seed int64) (int16, error)
- func ExactLog2(powerOf2 int) (int, error)
- func FindWithInequality[C comparable](arr []C, low int, high int, v C, crit Inequality, ...) (int, error)
- func FloorPowerOf2(n int64) int64
- func GetShortLE(array []byte, offset int) int
- func HashByteArrMurmur3(key []byte, offsetBytes int, lengthBytes int, seed uint64) (uint64, uint64)
- func HashCharSliceMurmur3(key []byte, offsetChars int, lengthChars int, seed uint64) (uint64, uint64)
- func HashInt32SliceMurmur3(key []int32, offsetInts int, lengthInts int, seed uint64) (uint64, uint64)
- func HashInt64SliceMurmur3(key []int64, offsetLongs int, lengthLongs int, seed uint64) (uint64, uint64)
- func InvPow2(e int) (float64, error)
- func IsNil[T any](t T) bool
- func IsPowerOf2(powerOf2 int) bool
- func LgSizeFromCount(n uint32, loadFactor float64) uint8
- func Log2Floor(n uint32) uint8
- func PutShortLE(array []byte, offset int, value int)
- func QuickSelect[T cmp.Ordered](arr []T, lo int, hi int, pivot int) T
- func QuickSelectFunc[T any](arr []T, lo int, hi int, pivot int, compare func(a, b T) int) T
- type Inequality
- type SimpleMurmur3
Constants ¶
const ( C1 = 0x87c37b91114253d5 C2 = 0x4cf5ad432745937f )
const ( JavaPath = "../serialization_test_data/java_generated_files" CppPath = "../serialization_test_data/cpp_generated_files" GoPath = "../serialization_test_data/go_generated_files" )
const (
DEFAULT_UPDATE_SEED = uint64(9001)
)
const (
DSketchTestGenerateGo = "DSKETCH_TEST_GENERATE_GO"
)
const (
InverseGolden = float64(0.6180339887498949025)
)
Variables ¶
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,
},
VarOptItemsUnion: family{
Id: 14,
MaxPreLongs: 4,
},
}
Functions ¶
func CeilPowerOf2 ¶
CeilPowerOf2 returns the smallest power of 2 greater than or equal to n.
func ComputeSeedHash ¶
func FindWithInequality ¶
func FindWithInequality[C comparable](arr []C, low int, high int, v C, crit Inequality, comparator common.CompareFn[C]) (int, error)
FindWithInequality performs a binary search for the index of the value in the given search range that satisfies the given inequality criterion. It returns -1 if there are no values in the search range that satisfy the criterion.
The arr must be sorted in increasing order according to the comparator. The low and high parameters define the inclusive search range [low, high]. The crit parameter must be one of InequalityLT, InequalityLE, InequalityGE, or InequalityGT.
func FloorPowerOf2 ¶
func GetShortLE ¶
GetShortLE gets a short value from a byte array in little endian format.
func HashByteArrMurmur3 ¶
func HashCharSliceMurmur3 ¶
func HashInt32SliceMurmur3 ¶
func HashInt64SliceMurmur3 ¶
func IsPowerOf2 ¶
IsPowerOf2 returns true if the given number is a power of 2.
func LgSizeFromCount ¶
func PutShortLE ¶
PutShortLE puts a short value into a byte array in little endian format.
func QuickSelectFunc ¶
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. |