algo

package
v0.9.4 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2017 License: AGPL-3.0, Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package algo contains algorithms such as merging, intersecting sorted lists.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyFilter

func ApplyFilter(u *intern.List, f func(uint64, int) bool)

ApplyFilter applies a filter to our UIDList.

func Difference added in v0.7.2

func Difference(u, v *intern.List) *intern.List

func IndexOf

func IndexOf(u *intern.List, uid uint64) int

IndexOf performs a binary search on the uids slice and returns the index at which it finds the uid, else returns -1

func IntersectCompressedWith added in v0.8.2

func IntersectCompressedWith(u []byte, afterUID uint64, v, o *intern.List)

func IntersectCompressedWithBin added in v0.8.2

func IntersectCompressedWithBin(bi *bp128.BPackIterator, q []uint64, o *[]uint64)

IntersectWithBin is based on the paper "Fast Intersection Algorithms for Sorted Sequences" https://link.springer.com/chapter/10.1007/978-3-642-12476-1_3

func IntersectCompressedWithLinJump added in v0.8.2

func IntersectCompressedWithLinJump(bi *bp128.BPackIterator, v []uint64, o *[]uint64)

func IntersectSorted

func IntersectSorted(lists []*intern.List) *intern.List

func IntersectWith

func IntersectWith(u, v, o *intern.List)

IntersectWith intersects u with v. The update is made to o. u, v should be sorted.

func IntersectWithBin added in v0.8.2

func IntersectWithBin(d, q []uint64, o *[]uint64)

IntersectWithBin is based on the paper "Fast Intersection Algorithms for Sorted Sequences" https://link.springer.com/chapter/10.1007/978-3-642-12476-1_3

func IntersectWithJump added in v0.8.2

func IntersectWithJump(u, v []uint64, o *[]uint64) (int, int)

func IntersectWithLin added in v0.8.2

func IntersectWithLin(u, v []uint64, o *[]uint64) (int, int)

func MergeSorted

func MergeSorted(lists []*intern.List) *intern.List

MergeSorted merges sorted lists.

func ToUintsListForTest

func ToUintsListForTest(ul []*intern.List) [][]uint64

ToUintsListForTest converts to list of uints for testing purpose only.

Types

This section is empty.

Jump to

Keyboard shortcuts

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