Board 0.9.6
Classes | Functions
Huffman.cpp File Reference

Build a Huffman tree. More...

#include <Board.h>
#include <map>
#include <vector>

Classes

struct  Node
 
struct  NodeGreaterThan
 

Functions

void extract_probabilities (const Node *tree, std::map< std::string, double > &m)
 
void extract_leaves (const Node *tree, std::vector< Node > &n)
 
Nodeclone (Node *node)
 
void fill_probabilities (Node *tree, const std::map< std::string, double > &m)
 
void fill_probabilities (Node *tree, double probability)
 
Group LeaveBox (const Node &node)
 
NodeHuffmanTree (const std::vector< Node > &nodes)
 
Nodecanonicalized (Node *tree)
 
void fill_codeword (const std::string codeword, Node *tree)
 
Group merge (Group left, Group right)
 
Group HuffmanTree (Node *node)
 
int main (int, char *[])
 

Detailed Description

Build a Huffman tree.

Author
Sebastien Fourey (GREYC)

This source code is part of the Board project, a C++ library whose purpose is to allow simple drawings in EPS, FIG or SVG files. Copyright (C) 2007 Sebastien Fourey https://fourey.users.greyc.fr

Function Documentation

◆ canonicalized()

Node * canonicalized ( Node tree)

◆ clone()

Node * clone ( Node node)

◆ extract_leaves()

void extract_leaves ( const Node tree,
std::vector< Node > &  n 
)

◆ extract_probabilities()

void extract_probabilities ( const Node tree,
std::map< std::string, double > &  m 
)

◆ fill_codeword()

void fill_codeword ( const std::string  codeword,
Node tree 
)

◆ fill_probabilities() [1/2]

void fill_probabilities ( Node tree,
const std::map< std::string, double > &  m 
)

◆ fill_probabilities() [2/2]

void fill_probabilities ( Node tree,
double  probability 
)

◆ HuffmanTree() [1/2]

Node * HuffmanTree ( const std::vector< Node > &  nodes)

◆ HuffmanTree() [2/2]

Group HuffmanTree ( Node node)

◆ LeaveBox()

Group LeaveBox ( const Node node)

◆ main()

int main ( int  ,
char *  [] 
)

◆ merge()

Group merge ( Group  left,
Group  right 
)