encoding

package module
v0.0.0-...-b90e310 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2017 License: Apache-2.0 Imports: 2 Imported by: 56

README

Encoding

This is a set of integer compression algorithms implemented in Go. It is an (incomplete) port of the JavaFastPFOR by Dr. Daniel Lemire.

For more detailed benchmark results please see http://zhen.org/blog/benchmarking-integer-compression-in-go/

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CeilBy

func CeilBy(value, factor int) int

func Delta

func Delta(in, out []int32, offset int32)

func DeltaMaxBits

func DeltaMaxBits(initoffset int32, buf []int32) int32

func FloorBy

func FloorBy(value, factor int) int

func InverseDelta

func InverseDelta(in, out []int32, offset int32)

func InverseZigZagDelta

func InverseZigZagDelta(in, out []int32)

func LeadingBitPosition

func LeadingBitPosition(x uint32) int32

func MaxBits

func MaxBits(buf []int32) int32

func PrintInt32sInBits

func PrintInt32sInBits(buf []int32)

func UnrolledDelta128

func UnrolledDelta128(in, out []int32, offset int32)

The following are unrolled versions, but they are probably slower due to range checks

func UnrolledInverseDelta128

func UnrolledInverseDelta128(in, out []int32, offset int32)

func UnrolledLeadingBitFrequency128

func UnrolledLeadingBitFrequency128(in, freqs []int32)

Types

type Integer

type Integer interface {
	// Compress data from an array to another array.
	//
	// Both inpos and outpos are modified to represent how much data was read and written to
	// if 12 ints (inlength = 12) are compressed to 3 ints, then inpos will be incremented by 12
	// while outpos will be incremented by 3 we use IntWrapper to pass the values by reference.
	// @param in  input array
	// @param inpos location in the input array
	// @param inlength how many integers to compress
	// @param out output array
	//* @param outpos  where to write in the output array
	Compress(in []int32, inpos *cursor.Cursor, inlength int, out []int32, outpos *cursor.Cursor) error

	/**
	 * Uncompress data from an array to another array.
	 *
	 * Both inpos and outpos parameters are modified to indicate new positions after read/write.
	 *
	 * @param in array containing data in compressed form
	 * @param inpos where to start reading in the array
	 * @param inlength length of the compressed data (ignored by some schemes)
	 * @param out array where to write the compressed output
	 * @param outpos where to write the compressed output in out
	 */
	Uncompress(in []int32, inpos *cursor.Cursor, inlength int, out []int32, outpos *cursor.Cursor) error
}

Directories

Path Synopsis
Package bp32 is an implementation of the binary packing integer compression algorithm in in Go (also known as PackedBinary) using 32-integer blocks.
Package bp32 is an implementation of the binary packing integer compression algorithm in in Go (also known as PackedBinary) using 32-integer blocks.
delta
Package fastpfor is an implementation of the fastpfor integer compression algorithm in in Go.
Package fastpfor is an implementation of the fastpfor integer compression algorithm in in Go.
zigzag

Jump to

Keyboard shortcuts

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