compexperiments

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2024 License: Apache-2.0 Imports: 5 Imported by: 0

README

compexperiments

experiments around compression

Documentation

Index

Constants

View Source
const MaxGroups = 4 * len(BlockHeader{})

Variables

This section is empty.

Functions

func AddTailConst added in v1.0.0

func AddTailConst[T PackType](v T)

Types

type BlockHeader

type BlockHeader [2]uint64

BlockHeader is a uint64 used to store the number of bits in a group (7 bits) and the number of trailing zeros (6 bits). up to 4 groups can be stored in a block header. the number of groups are stored in the first 4 bits of the header.

func (BlockHeader) AddGroup

func (bh BlockHeader) AddGroup(bitlen, ntz int) BlockHeader

AddGroup adds a group of bits to the block header. bitlen is the number of bits in the group, and ntz is the number of trailing zeros. bitlen and ntz are stored in the header as 7 and 6-bit values. adding a group increases the number of groups in the header by 1.

func (BlockHeader) BlockLen

func (bh BlockHeader) BlockLen() int

BlockLen returns the number of compressed uint64 in the block not including the header.

func (BlockHeader) GetGroup

func (bh BlockHeader) GetGroup(i int) (int, int)

GetGroup returns the bitlen and ntz of the group at index i.

func (BlockHeader) GroupCount

func (bh BlockHeader) GroupCount() int

GroupCount returns the number of groups in the block header.

type BytesSlice

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

func (*BytesSlice) Len

func (bs *BytesSlice) Len() int

func (*BytesSlice) Reset

func (bs *BytesSlice) Reset()

func (*BytesSlice) Value

func (bs *BytesSlice) Value(i int) []byte

func (*BytesSlice) Values

func (bs *BytesSlice) Values(dst [][]byte) [][]byte

func (*BytesSlice) ValuesBytes

func (bs *BytesSlice) ValuesBytes() ([]byte, []int64)

type CompressedBytesSlice

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

func (*CompressedBytesSlice) Add added in v1.0.0

func (cs *CompressedBytesSlice) Add(src [][]byte, encoder any)

func (*CompressedBytesSlice) AddBytes added in v1.0.0

func (cs *CompressedBytesSlice) AddBytes(src []byte, offsets []int64, encoder any)

func (*CompressedBytesSlice) AddOne added in v1.0.0

func (cs *CompressedBytesSlice) AddOne(src []byte, encoder any)

func (CompressedBytesSlice) Append added in v1.0.0

func (cs CompressedBytesSlice) Append(src [][]byte, encoder any) CompressedBytesSlice

func (CompressedBytesSlice) AppendBytes added in v1.0.0

func (cs CompressedBytesSlice) AppendBytes(src []byte, offsets []int64, encoder any) CompressedBytesSlice

func (CompressedBytesSlice) AppendOne added in v1.0.0

func (cs CompressedBytesSlice) AppendOne(src []byte, encoder any) CompressedBytesSlice

func (*CompressedBytesSlice) BlockCount

func (cs *CompressedBytesSlice) BlockCount() int

func (*CompressedBytesSlice) BlockDataLen

func (cs *CompressedBytesSlice) BlockDataLen(iBlock int) int

func (*CompressedBytesSlice) BlockLen

func (cs *CompressedBytesSlice) BlockLen(iBlock int) int

func (*CompressedBytesSlice) BlockNum added in v1.0.0

func (cs *CompressedBytesSlice) BlockNum(i int) int

BlockNum returns the block (iBlock) given the index in the uncompressed slice

func (*CompressedBytesSlice) CompressedSize

func (cs *CompressedBytesSlice) CompressedSize() int

func (*CompressedBytesSlice) DataLen

func (cs *CompressedBytesSlice) DataLen() int

func (*CompressedBytesSlice) DeepCopy added in v1.0.0

func (cs *CompressedBytesSlice) DeepCopy() (copy CompressedBytesSlice)

DeepCopy returns a deep copy of the compressed bytes slice it is mainly used to be used in cunjunction with Truncate

func (*CompressedBytesSlice) Export added in v1.0.0

func (cs *CompressedBytesSlice) Export() ([]byte, []byte, []int64, int64, CompressedSlice[int64])

func (*CompressedBytesSlice) Get added in v1.0.0

func (cs *CompressedBytesSlice) Get(i int, decoder any) []byte

func (*CompressedBytesSlice) GetAll added in v1.0.0

func (cs *CompressedBytesSlice) GetAll(dst BytesSlice, decoder any) BytesSlice

func (*CompressedBytesSlice) GetBlock added in v1.0.0

func (cs *CompressedBytesSlice) GetBlock(dst BytesSlice, iBlock int, decoder any) (BytesSlice, int)

func (*CompressedBytesSlice) GetBlockBytes added in v1.0.0

func (cs *CompressedBytesSlice) GetBlockBytes(dst []byte, dstOffsets []int64, iBlock int, decoder any) ([]byte, []int64, int)

func (*CompressedBytesSlice) GetBytes added in v1.0.0

func (cs *CompressedBytesSlice) GetBytes(dst []byte, dstOffsets []int64, decoder any) ([]byte, []int64)

func (*CompressedBytesSlice) Import added in v1.0.0

func (cs *CompressedBytesSlice) Import(buf []byte, tail []byte, bufBlockOffsets []int64, lastOffset int64, offsets CompressedSlice[int64])

func (*CompressedBytesSlice) IsBlockCompressed

func (cs *CompressedBytesSlice) IsBlockCompressed(iBlock int) bool

func (*CompressedBytesSlice) Len

func (cs *CompressedBytesSlice) Len() int

func (*CompressedBytesSlice) MemSize

func (cs *CompressedBytesSlice) MemSize() int

func (*CompressedBytesSlice) RemainingCapBytes added in v1.0.0

func (cs *CompressedBytesSlice) RemainingCapBytes() int

func (*CompressedBytesSlice) Truncate added in v1.0.0

func (cs *CompressedBytesSlice) Truncate(i int, decoder any)

type CompressedSlice

type CompressedSlice[T PackType] struct {
	// contains filtered or unexported fields
}

func (*CompressedSlice[T]) Add added in v1.0.0

func (cs *CompressedSlice[T]) Add(src []T)

func (*CompressedSlice[T]) AddLossy added in v1.0.0

func (cs *CompressedSlice[T]) AddLossy(src []T, maxBits int)

func (*CompressedSlice[T]) AddOne added in v1.0.0

func (cs *CompressedSlice[T]) AddOne(src T)

func (*CompressedSlice[T]) AddOneLossy added in v1.0.0

func (cs *CompressedSlice[T]) AddOneLossy(src T, maxBits int)

func (CompressedSlice[T]) Append added in v1.0.0

func (cs CompressedSlice[T]) Append(src []T) CompressedSlice[T]

func (CompressedSlice[T]) AppendLossy added in v1.0.0

func (cs CompressedSlice[T]) AppendLossy(src []T, maxBits int) CompressedSlice[T]

func (CompressedSlice[T]) AppendOne added in v1.0.0

func (cs CompressedSlice[T]) AppendOne(src T) CompressedSlice[T]

func (CompressedSlice[T]) AppendOneLossy added in v1.0.0

func (cs CompressedSlice[T]) AppendOneLossy(src T, maxBits int) CompressedSlice[T]

func (*CompressedSlice[T]) BlockCount

func (cs *CompressedSlice[T]) BlockCount() int

func (*CompressedSlice[T]) BlockFirstValue

func (cs *CompressedSlice[T]) BlockFirstValue(iBlock int) T

func (*CompressedSlice[T]) BlockLen

func (cs *CompressedSlice[T]) BlockLen(iBlock int) int

func (*CompressedSlice[T]) BlockMinMax

func (cs *CompressedSlice[T]) BlockMinMax(iBlock int) (T, T)

func (*CompressedSlice[T]) BlockNum added in v1.0.0

func (cs *CompressedSlice[T]) BlockNum(i int) int

BlockNum returns the block (iBlock) given the index in the uncompressed slice

func (*CompressedSlice[T]) CompressedSize

func (cs *CompressedSlice[T]) CompressedSize() int

func (*CompressedSlice[T]) DeepCopy added in v1.0.0

func (cs *CompressedSlice[T]) DeepCopy() (copy CompressedSlice[T])

DeepCopy returns a deep copy of the CompressedSlice mainly designed to be used in conjunction Truncate

func (*CompressedSlice[T]) Export added in v1.0.0

func (cs *CompressedSlice[T]) Export() ([]uint64, []T, []int64, []minMax[T])

func (*CompressedSlice[T]) FirstValue added in v1.0.0

func (cs *CompressedSlice[T]) FirstValue() T

func (*CompressedSlice[T]) Get added in v1.0.0

func (cs *CompressedSlice[T]) Get(i int) T

func (*CompressedSlice[T]) GetAll added in v1.0.0

func (cs *CompressedSlice[T]) GetAll(dst []T) []T

func (*CompressedSlice[T]) GetBlock added in v1.0.0

func (cs *CompressedSlice[T]) GetBlock(dst []T, iBlock int) ([]T, int)

func (*CompressedSlice[T]) Import added in v1.0.0

func (cs *CompressedSlice[T]) Import(buf []uint64, tail []T, blockOffsets []int64, minMax []minMax[T])

func (*CompressedSlice[T]) IsBlockCompressed

func (cs *CompressedSlice[T]) IsBlockCompressed(iBlock int) bool

func (*CompressedSlice[T]) LShiftBlocks added in v1.0.0

func (cs *CompressedSlice[T]) LShiftBlocks(nBlocks int)

func (*CompressedSlice[T]) LastValue added in v1.0.0

func (cs *CompressedSlice[T]) LastValue() T

func (*CompressedSlice[T]) Len

func (cs *CompressedSlice[T]) Len() int

func (*CompressedSlice[T]) MemSize

func (cs *CompressedSlice[T]) MemSize() int

func (*CompressedSlice[T]) RemainingCapBytes added in v1.0.0

func (cs *CompressedSlice[T]) RemainingCapBytes() int

func (*CompressedSlice[T]) Truncate added in v1.0.0

func (cs *CompressedSlice[T]) Truncate(i int)

func (*CompressedSlice[T]) WithMinMax

func (cs *CompressedSlice[T]) WithMinMax(v bool)

type PackType

type PackType interface {
	~int | ~int32 | ~uint32 | ~int64 | ~uint64 | ~float32 | ~float64
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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