frequency_table

package
v0.0.0-...-0083697 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2023 License: MIT Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FlatFrequencyTable

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

func NewFlatFrequencyTable

func NewFlatFrequencyTable(numSymbols uint) *FlatFrequencyTable

func (*FlatFrequencyTable) Get

func (self *FlatFrequencyTable) Get(symbol uint) uint

func (*FlatFrequencyTable) GetHigh

func (self *FlatFrequencyTable) GetHigh(symbol uint) uint

func (*FlatFrequencyTable) GetLow

func (self *FlatFrequencyTable) GetLow(symbol uint) uint

func (*FlatFrequencyTable) GetSymbolLimit

func (self *FlatFrequencyTable) GetSymbolLimit() uint

func (*FlatFrequencyTable) GetTotal

func (self *FlatFrequencyTable) GetTotal() uint

func (*FlatFrequencyTable) Increment

func (self *FlatFrequencyTable) Increment(symbol uint)

func (*FlatFrequencyTable) Set

func (self *FlatFrequencyTable) Set(symbol uint, freq uint)

func (*FlatFrequencyTable) String

func (self *FlatFrequencyTable) String() string

type FrequencyTable

type FrequencyTable interface {
	String() string
	// Returns the number of symbols in this frequency table.
	GetSymbolLimit() uint
	// Returns the frequency of the given symbol.
	Get(symbol uint) uint
	// Sets the frequency of the given symbol to the given value.
	Set(symbol uint, freq uint)
	// Increments the frequency of the given symbol.
	Increment(symbol uint)
	// Returns the total of all symbol frequencies.
	// The returned value is always equal to getHigh(getSymbolLimit() - 1).
	GetTotal() uint
	// Returns the sum of the frequencies of all the symbols strictly below the given symbol value.
	GetLow(symbol uint) uint
	// Returns the sum of the frequencies of the given symbol and all the symbols below.
	GetHigh(symbol uint) uint
}

type SimpleFrequencyTable

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

func NewSimpleFrequencyTable

func NewSimpleFrequencyTable(freqs *FrequencyTable) *SimpleFrequencyTable

func (*SimpleFrequencyTable) Get

func (self *SimpleFrequencyTable) Get(symbol uint) uint

func (*SimpleFrequencyTable) GetHigh

func (self *SimpleFrequencyTable) GetHigh(symbol uint) uint

func (*SimpleFrequencyTable) GetLow

func (self *SimpleFrequencyTable) GetLow(symbol uint) uint

func (*SimpleFrequencyTable) GetSymbolLimit

func (self *SimpleFrequencyTable) GetSymbolLimit() uint

func (*SimpleFrequencyTable) GetTotal

func (self *SimpleFrequencyTable) GetTotal() uint

func (*SimpleFrequencyTable) Increment

func (self *SimpleFrequencyTable) Increment(symbol uint)

func (*SimpleFrequencyTable) Set

func (self *SimpleFrequencyTable) Set(symbol uint, freq uint)

func (*SimpleFrequencyTable) String

func (self *SimpleFrequencyTable) String() string

Jump to

Keyboard shortcuts

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