|
Board 0.9.6
|
Build a Huffman tree. More...
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) |
| Node * | clone (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) |
| Node * | HuffmanTree (const std::vector< Node > &nodes) |
| Node * | canonicalized (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 *[]) |
Build a Huffman tree.
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
References clone(), extract_leaves(), extract_probabilities(), fill_probabilities(), and HuffmanTree().
Referenced by main().
References clone(), Node::left, Node::probability, Node::right, and Node::symbol.
Referenced by canonicalized(), and clone().
References extract_leaves(), Node::left, Node::probability, Node::right, and Node::symbol.
Referenced by canonicalized(), and extract_leaves().
| void extract_probabilities | ( | const Node * | tree, |
| std::map< std::string, double > & | m | ||
| ) |
References extract_probabilities(), Node::left, Node::probability, Node::right, and Node::symbol.
Referenced by canonicalized(), and extract_probabilities().
| void fill_codeword | ( | const std::string | codeword, |
| Node * | tree | ||
| ) |
References Node::codeword, fill_codeword(), Node::left, and Node::right.
Referenced by fill_codeword(), and main().
| void fill_probabilities | ( | Node * | tree, |
| const std::map< std::string, double > & | m | ||
| ) |
References fill_probabilities(), Node::left, Node::probability, Node::right, and Node::symbol.
Referenced by canonicalized(), fill_probabilities(), and fill_probabilities().
| void fill_probabilities | ( | Node * | tree, |
| double | probability | ||
| ) |
References fill_probabilities(), Node::left, Node::probability, and Node::right.
References Node::probability, and Node::symbol.
Referenced by canonicalized(), HuffmanTree(), and main().
References HuffmanTree(), LeaveBox(), Node::left, merge(), and Node::right.
References LibBoard::ShapeList::append(), LibBoard::Color::Black, LibBoard::Color::Blue, LibBoard::boardFontText(), Node::codeword, LibBoard::framed(), LibBoard::Color::Null, Node::probability, Node::symbol, and text().
Referenced by HuffmanTree().
| int main | ( | int | , |
| char * | [] | ||
| ) |
References LibBoard::Shape::bbox(), LibBoard::Color::Black, LibBoard::boardFontText(), LibBoard::Group::boundingBox(), LibBoard::Shape::center(), LibBoard::ShapeList::clear(), LibBoard::Color::Green, LibBoard::Rect::growed(), LibBoard::Rect::height, LibBoard::mix(), LibBoard::Shape::moveCenter(), LibBoard::Color::Null, LibBoard::Path::Open, LibBoard::rectangle(), LibBoard::Color::White, and LibBoard::Rect::width.
Referenced by HuffmanTree().