Documentation ¶
Index ¶
- Constants
- Variables
- func Byte4ToInt(b byte) int
- func BytesDifference(priorTerm, currentTerm []byte) (int, error)
- func Int4ToLong(i int) int64
- func IntToByte4(i int) byte
- func Log(x, base int) int
- func LongToInt4(i int64) int
- func NextUp(f float64) float64
- func RandomId() []byte
- func SelectK(k int, data sort.Interface)
- func SelectorCheckArgs(from, to, k int)
- func SumRelativeErrorBound(numValues int) float64
- type Bits
- type IntroSelector
- type IntroSelectorConfig
- type RefCount
- type Selector
Constants ¶
View Source
const (
ID_LENGTH = 16
)
Variables ¶
View Source
var ( MaxInt4 = LongToInt4(math.MaxInt32) NumFreeValues = 255 - MaxInt4 )
Functions ¶
func Byte4ToInt ¶
func BytesDifference ¶
func Int4ToLong ¶
func IntToByte4 ¶
func LongToInt4 ¶
func SelectorCheckArgs ¶
func SelectorCheckArgs(from, to, k int)
func SumRelativeErrorBound ¶
SumRelativeErrorBound Return a relative error bound for a sum of numValues positive doubles, computed using recursive summation, ie. sum = x1 + ... + xn. NOTE: This only works if all values are POSITIVE so that Σ |xi| == |Σ xi|. This uses formula 3.5 from Higham, Nicholas J. (1993), "The accuracy of floating point summation", SIAM Journal on Scientific Computing.
Types ¶
type Bits ¶
type Bits interface { // Test Returns the value of the bit with the specified index. // Params: index – index, should be non-negative and < length(). The result of passing negative or out of // bounds values is undefined by this interface, just don't do it! // Returns: true if the bit is set, false otherwise. Test(index uint) bool // Len Returns the number of bits in this set Len() uint }
Bits Interface for Bitset-like structures.
type IntroSelector ¶
type IntroSelector struct {
// contains filtered or unexported fields
}
func NewIntroSelector ¶
func NewIntroSelector(cfg *IntroSelectorConfig) *IntroSelector
func (*IntroSelector) Select ¶
func (r *IntroSelector) Select(from, to, k int)
func (*IntroSelector) Swap ¶
func (r *IntroSelector) Swap(i, j int)
type IntroSelectorConfig ¶
type RefCount ¶
func NewRefCount ¶
func (*RefCount[T]) DecRef ¶
DecRef Decrements the reference counting of this object. When reference counting hits 0, calls release().
func (*RefCount[T]) GetRefCount ¶
GetRefCount Returns the current reference count.
type Selector ¶
type Selector interface { // Select Reorder elements so that the element at position k is the same as if all elements were // sorted and all other elements are partitioned around it: [from, k) only contains elements that // are less than or equal to k and (k, to) only contains elements that are greater than or equal to k. Select(from, to, k int) // Swap values at slots i and j. Swap(i, j int) }
Selector An implementation of a selection algorithm, ie. computing the k-th greatest value from a collection.
Source Files ¶
Click to show internal directories.
Click to hide internal directories.