KASKADE 7 development version
Loading...
Searching...
No Matches
PrefixCode< Symbol, State_ > Class Template Reference

#include <prefixcoder.hh>

Public Types

using State = State_

Public Member Functions

 PrefixCode (CodeBook< State, Symbol > &&codebook_)
int maxLen () const
 Returns the maximum length of any codeword (in bits).
std::pair< State, int > code (Symbol s) const
 For a symbol \( s \), return the pair \( (c,n) \) of code word \( c \) (in the least significant bits) and code length \( n\).
bool hasSymbol (Symbol s) const
 Checks whether the given symbol exists in the codebook.
std::pair< Symbol, int > symbol (State code) const
 For an encoded message fraction of \( m \) bits ( \( m \) being the maximum code length), return the pair \( (s,n) \) of symbol \( s \) and code length \( n \).
void printCodebook () const

Detailed Description

template<class Symbol, class State_ = uint64_t>
class PrefixCode< Symbol, State_ >

Definition at line 52 of file prefixcoder.hh.

Member Typedef Documentation

◆ State

template<class Symbol, class State_ = uint64_t>
using PrefixCode< Symbol, State_ >::State = State_

Definition at line 94 of file prefixcoder.hh.

Constructor & Destructor Documentation

◆ PrefixCode()

template<class Symbol, class State_ = uint64_t>
PrefixCode< Symbol, State_ >::PrefixCode ( CodeBook< State, Symbol > && codebook_)
inline

Definition at line 96 of file prefixcoder.hh.

Member Function Documentation

◆ code()

template<class Symbol, class State_ = uint64_t>
std::pair< State, int > PrefixCode< Symbol, State_ >::code ( Symbol s) const
inline

For a symbol \( s \), return the pair \( (c,n) \) of code word \( c \) (in the least significant bits) and code length \( n\).

Definition at line 130 of file prefixcoder.hh.

Referenced by PrefixEncoder< Symbol, OIter, Output, State >::push_back(), and symbol().

◆ hasSymbol()

template<class Symbol, class State_ = uint64_t>
bool PrefixCode< Symbol, State_ >::hasSymbol ( Symbol s) const
inline

Checks whether the given symbol exists in the codebook.

Definition at line 141 of file prefixcoder.hh.

◆ maxLen()

template<class Symbol, class State_ = uint64_t>
int PrefixCode< Symbol, State_ >::maxLen ( ) const
inline

Returns the maximum length of any codeword (in bits).

Definition at line 121 of file prefixcoder.hh.

◆ printCodebook()

template<class Symbol, class State_ = uint64_t>
void PrefixCode< Symbol, State_ >::printCodebook ( ) const
inline

Definition at line 156 of file prefixcoder.hh.

◆ symbol()

template<class Symbol, class State_ = uint64_t>
std::pair< Symbol, int > PrefixCode< Symbol, State_ >::symbol ( State code) const
inline

For an encoded message fraction of \( m \) bits ( \( m \) being the maximum code length), return the pair \( (s,n) \) of symbol \( s \) and code length \( n \).

Definition at line 151 of file prefixcoder.hh.

Referenced by PrefixDecoder< Symbol, IIter, Input, State >::pop_front(), PrefixCode(), and printCodebook().


The documentation for this class was generated from the following file: