Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
btreepic.C File Reference

Binary tree visualization tool: convert a .Tree description into LaTeX/eepic. More...

#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <iostream>
#include <aleph.H>
#include <tpl_dynDlist.H>
#include <tpl_binNode.H>
#include <tpl_binNodeUtils.H>
#include <tpl_dynArray.H>
#include <tpl_sort_utils.H>
#include <tclap/CmdLine.h>
#include "parse_utils.H"
#include "treepic_utils.H"
Include dependency graph for btreepic.C:

Go to the source code of this file.

Classes

struct  Tag_Data
 
struct  Arc_Desc
 
struct  Arc_Data
 
struct  Thread_Desc
 
struct  Thread_Data
 
struct  Split_Data
 
struct  Line_Distance_Data
 
class  EepicNode_Data
 
class  EepicNode< Key >
 
class  EepicNodeVtl< Key >
 

Macros

#define INFIXPOS(p)   ((p)->getCount())
 
#define LEVEL(p)   ((p)->get_level())
 
#define X(p)   ((p)->get_x())
 
#define Y(p)   ((p)->get_y())
 
#define XOFFSET(p)   ((p)->get_xoffset())
 
#define YOFFSET(p)   ((p)->get_yoffset())
 
#define TRIANGLEH(p)   ((p)->get_triangle_height())
 
#define RECTANGLEH(p)   ((p)->get_rectangle_height())
 
#define EXTERNAL(p)   ((p)->get_external_node())
 
#define ISEXTERNAL(p)   ((p)->is_external())
 
#define ISTRIANGLE(p)   ((p)->is_triangle())
 
#define DSTRING(p)   ((p)->get_distance_string())
 
#define LDISTANCE(p)   ((p)->get_line_distance_data())
 
#define ISDISTANCE(p)   ((p)->get_line_distance_data().str.empty())
 
#define ISRECTANGLE(p)   ((p)->is_rectangle())
 
#define STRING(p)   ((p)->get_key_string())
 
#define AUX(p)   ((p)->get_aux_string())
 
#define SHADOW(p)   ((p)->get_shadow())
 
#define WITHOUT(p)   ((p)->get_without_node())
 
#define SCRATCH(p)   ((p)->get_scratch())
 
#define WITHARC(p)   ((p)->get_with_arc())
 
#define DASHLLINK(p)   ((p)->get_dash_llink())
 
#define DASHRLINK(p)   ((p)->get_dash_rlink())
 
#define TAGLIST(p)   ((p)->get_tag_list())
 
#define ARCLIST(p)   ((p)->get_arc_list())
 
#define THREADLIST(p)   ((p)->get_thread_list())
 
#define SUCC(p)   ((p)->get_succ())
 
#define PREV(p)   ((p)->get_prev())
 
#define TERMINATE(n)   (save_parameters(), exit(n))
 
#define DYNARRAY_APPEND(array, item)   (array[array.size()] = item)
 

Typedefs

typedef Token_Type Tag_Option
 

Enumerations

enum  Token_Type {
  NUMBER , STRING , START_PREFIX , START_INFIX ,
  START_KEY , START_AUX , SHADOW_NODE , WITHOUT_NODE ,
  TAG , ARC , DASHED_ARC , SCRATCH ,
  SPLIT , KEY , XOFFSET , YOFFSET ,
  TRIANGLE , TRIANGLEH , WITHOUT_ARC , COMMENT ,
  RECTANGLE , PARRECTANGLE , DISTANCE , LEFT ,
  RIGHT , THREAD , NORTH , SOUTH ,
  EAST , WEST , NORTH_EAST , NORTH_WEST ,
  SOUTH_EAST , SOUTH_WEST , END_FILE , INVALID
}
 
enum  Parsing_State {
  PREFIX , INFIX , KEYS , AUX ,
  SHADOW , WITHOUT
}
 

Functions

void save_parameters ()
 
void read_parameters ()
 
Token_Type get_token (ifstream &input_stream)
 
void load_tag_option (ifstream &input_stream)
 
void load_arc_option (ifstream &input_stream, const Token_Type &token_type)
 
void load_thread_option (ifstream &input_stream)
 
void load_split_option (ifstream &input_stream)
 
void load_key_option (ifstream &input_stream)
 
void load_offset_option (ifstream &input_stream, DynArray< long > &positions, DynArray< long double > &offsets)
 
void load_triangleh_option (ifstream &input_stream)
 
void load_triangle_option (ifstream &input_stream)
 
void load_rectangle_option (ifstream &input_stream)
 
void load_parrectangle_option (ifstream &input_stream)
 
void load_distance_option (ifstream &input_stream)
 
void assign_key (EepicNode< long > *p, int, const int position)
 
void assign_aux (EepicNode< long > *p, int, const int position)
 
void assign_shadow (EepicNode< long > *p, int, const int position)
 
void reassign_key (EepicNode< long > *p, int, const int position)
 
void assign_without_node (EepicNode< long > *p, int, const int position)
 
void assign_tag (EepicNode< long > *p, int, const int position)
 
template<class Node >
Nodeselect (Node *root, const int &i)
 
void assign_arcs (EepicNode< long > *root, EepicNode< long > *p)
 
void assign_external_nodes (EepicNode< long > *p)
 
void assign_scratch (EepicNode< long > *p, int, const int position)
 
void assign_xoffset (EepicNode< long > *p, int, const int position)
 
void assign_yoffset (EepicNode< long > *p, int, const int position)
 
void assign_triangle (EepicNode< long > *p, int, const int position)
 
void assign_rectangle (EepicNode< long > *p, int, const int position)
 
void assign_parrectangle (EepicNode< long > *p, int, const int position)
 
void assign_distance (EepicNode< long > *p, int, const int position)
 
void assign_without_arc (EepicNode< long > *p, int, const int position)
 
void assign_pos_and_level (EepicNode< long > *p, const int level, const int position)
 
void thread_tree (EepicNode< long > *p)
 
void file_to_dynarrays (const char *file_name)
 
bool north_offset (EepicNode< long > *p)
 
bool east_offset (EepicNode< long > *root)
 
bool west_offset (EepicNode< long > *root)
 
bool south_offset (EepicNode< long > *root, const size_t &level)
 
void adjust_size_by_tags (EepicNode< long > *root, const size_t &height)
 
void set_picture_size (EepicNode< long > *p)
 
void compute_picture_size (EepicNode< long > *p)
 
EepicNode< long > * build_tree ()
 
void generate_prologue (ofstream &output)
 
void generate_epilogue (ofstream &output)
 
void generate_tree (ofstream &output, EepicNode< long > *p)
 
void generate_split_lines (ofstream &output, EepicNode< long > *root)
 
void print_parameters ()
 
int main (int argc, char *argv[])
 

Variables

long double hr = 10
 
long double vr = 10
 
long double hd = 2 * hr
 
long double vd = 2 * vr
 
long double w = 20
 
long double h = 35
 
long double h_size = 110
 
double v_size = 190
 
long double x_offset = 0
 
long double y_offset = 0
 
long double x_aux_offset = 0
 
long double y_aux_offset = 0
 
long double x_picture_offset = 0
 
long double y_picture_offset = 0
 
string command_line
 
string input_file_name
 
string output_file_name
 
int num_nodes = 0
 
bool verbose_mode = true
 
bool silent_mode = true
 
bool latex_header = false
 
bool landscape = false
 
bool fit_mode = false
 
bool draw_node_mode = true
 
bool printing_key_mode = false
 
bool with_string_key = false
 
bool with_string_aux = false
 
bool threaded_trees = false
 
bool dash_threaded_trees = false
 
bool with_external_nodes = false
 
bool draw_nodes = true
 
const char * parameters_file_name = "./.btreepic"
 
DynArray< long > prefix_dynarray
 
DynArray< long > infix_dynarray
 
DynArray< string > key_print_dynarray
 
DynArray< string > aux_print_dynarray
 
DynArray< long > shadow_dynarray
 
DynArray< long > without_node_dynarray
 
DynArray< Tag_Datatag_data_dynarray
 
DynArray< long > tag_pos_dynarray
 
DynArray< long > source_arc_dynarray
 
DynArray< Arc_Datatarget_arc_dynarray
 
DynArray< long > source_thread_dynarray
 
DynArray< Thread_Datatarget_thread_dynarray
 
DynArray< long > scratch_dynarray
 
DynArray< long > split_dynarray
 
DynArray< Split_Datasplit_string_dynarray
 
DynArray< long > key_pos_dynarray
 
DynArray< string > key_string_dynarray
 
DynArray< long > pos_xoffset_dynarray
 
DynArray< long double > xoffset_dynarray
 
DynArray< long > pos_yoffset_dynarray
 
DynArray< long double > yoffset_dynarray
 
DynArray< long > pos_triangle_dynarray
 
DynArray< long double > height_triangle_dynarray
 
DynArray< long double > height_rectangle_dynarray
 
DynArray< long > pos_rectangle_dynarray
 
DynArray< long double > height_parrectangle_dynarray
 
DynArray< long > pos_parrectangle_dynarray
 
DynArray< long > pos_distance_dynarray
 
DynArray< Line_Distance_Datadistance_dynarray
 
DynArray< long > without_arc_dynarray
 
int max_num_nodes_rectangle = 0
 
const char * argp_program_version
 
static auto hello
 
static constexpr char license_text []
 

Detailed Description

Binary tree visualization tool: convert a .Tree description into LaTeX/eepic.

Overview

btreepic reads a textual binary tree specification and emits LaTeX code using the eepic drawing primitives. It is intended for producing publication-ready diagrams of binary search trees and related annotated trees.

Input format (high level)

The input is a .Tree text file with traversal sections and optional annotation directives.

  • Required:
    • START-PREFIX / START-PREORDER followed by a preorder list.
  • Optional:
    • START-INFIX / START-INORDER followed by an inorder list.
    • START-KEY and START-AUX label sections.
    • directives that refer to nodes by inorder position (0-based), such as TAG, ARC, THREAD, RECTANGLE, TRIANGLE, etc.

This file contains a more exhaustive list of supported directives.

Usage / CLI

This program uses tclap.

Minimal usage (input is required):

# Read input.Tree and write output next to it
./btreepic -f input.Tree
# Same as -f
./btreepic -i input.Tree
# Choose output file explicitly
./btreepic -f input.Tree -o out.eepic

Output naming:

  • If -o is not provided, the output file name is derived from the input name by stripping the extension and appending:
    • .eepic (default)
    • .eepicaux if -K/--tiny-keys is enabled.

Common options (see --help for the full list):

  • Geometry: -r, -w, -h, -x, -y, -l, -z, -u
  • Key/label placement: -k, -K, -X, -Y, -W, -H
  • Rendering modes: -a, -p, -t, -N, -e, -A, -B, -S, -F
  • Threads: -D, -T
  • Misc: -R (print parameters), -v (verbose), -s (unsilent), -V (version), -C (license)

Output

The output is LaTeX/eepic code that can be embedded in a LaTeX document.

Pitfalls and edge cases

  • The input file must be provided (-f/-i), otherwise the program aborts.
  • Many directives use inorder positions; ensure the traversal sections match the intended tree.

References / see also

Author
Leandro Rabindranath León

Definition in file btreepic.C.

Macro Definition Documentation

◆ ARCLIST

#define ARCLIST (   p)    ((p)->get_arc_list())

Definition at line 396 of file btreepic.C.

◆ AUX

#define AUX (   p)    ((p)->get_aux_string())

Definition at line 388 of file btreepic.C.

◆ DASHLLINK

#define DASHLLINK (   p)    ((p)->get_dash_llink())

Definition at line 393 of file btreepic.C.

◆ DASHRLINK

#define DASHRLINK (   p)    ((p)->get_dash_rlink())

Definition at line 394 of file btreepic.C.

◆ DSTRING

#define DSTRING (   p)    ((p)->get_distance_string())

Definition at line 383 of file btreepic.C.

◆ DYNARRAY_APPEND

#define DYNARRAY_APPEND (   array,
  item 
)    (array[array.size()] = item)

Definition at line 509 of file btreepic.C.

◆ EXTERNAL

#define EXTERNAL (   p)    ((p)->get_external_node())

Definition at line 380 of file btreepic.C.

◆ INFIXPOS

#define INFIXPOS (   p)    ((p)->getCount())

Definition at line 372 of file btreepic.C.

◆ ISDISTANCE

#define ISDISTANCE (   p)    ((p)->get_line_distance_data().str.empty())

Definition at line 385 of file btreepic.C.

◆ ISEXTERNAL

#define ISEXTERNAL (   p)    ((p)->is_external())

Definition at line 381 of file btreepic.C.

◆ ISRECTANGLE

#define ISRECTANGLE (   p)    ((p)->is_rectangle())

Definition at line 386 of file btreepic.C.

◆ ISTRIANGLE

#define ISTRIANGLE (   p)    ((p)->is_triangle())

Definition at line 382 of file btreepic.C.

◆ LDISTANCE

#define LDISTANCE (   p)    ((p)->get_line_distance_data())

Definition at line 384 of file btreepic.C.

◆ LEVEL

#define LEVEL (   p)    ((p)->get_level())

Definition at line 373 of file btreepic.C.

◆ PREV

#define PREV (   p)    ((p)->get_prev())

Definition at line 399 of file btreepic.C.

◆ RECTANGLEH

#define RECTANGLEH (   p)    ((p)->get_rectangle_height())

Definition at line 379 of file btreepic.C.

◆ SCRATCH

#define SCRATCH (   p)    ((p)->get_scratch())

Definition at line 391 of file btreepic.C.

◆ SHADOW

#define SHADOW (   p)    ((p)->get_shadow())

Definition at line 389 of file btreepic.C.

◆ STRING

#define STRING (   p)    ((p)->get_key_string())

Definition at line 387 of file btreepic.C.

◆ SUCC

#define SUCC (   p)    ((p)->get_succ())

Definition at line 398 of file btreepic.C.

◆ TAGLIST

#define TAGLIST (   p)    ((p)->get_tag_list())

Definition at line 395 of file btreepic.C.

◆ TERMINATE

#define TERMINATE (   n)    (save_parameters(), exit(n))

Definition at line 507 of file btreepic.C.

◆ THREADLIST

#define THREADLIST (   p)    ((p)->get_thread_list())

Definition at line 397 of file btreepic.C.

◆ TRIANGLEH

#define TRIANGLEH (   p)    ((p)->get_triangle_height())

Definition at line 378 of file btreepic.C.

◆ WITHARC

#define WITHARC (   p)    ((p)->get_with_arc())

Definition at line 392 of file btreepic.C.

◆ WITHOUT

#define WITHOUT (   p)    ((p)->get_without_node())

Definition at line 390 of file btreepic.C.

◆ X

#define X (   p)    ((p)->get_x())

Definition at line 374 of file btreepic.C.

◆ XOFFSET

#define XOFFSET (   p)    ((p)->get_xoffset())

Definition at line 376 of file btreepic.C.

◆ Y

#define Y (   p)    ((p)->get_y())

Definition at line 375 of file btreepic.C.

◆ YOFFSET

#define YOFFSET (   p)    ((p)->get_yoffset())

Definition at line 377 of file btreepic.C.

Typedef Documentation

◆ Tag_Option

Definition at line 185 of file btreepic.C.

Enumeration Type Documentation

◆ Parsing_State

Enumerator
PREFIX 
INFIX 
KEYS 
AUX 
SHADOW 
WITHOUT 

Definition at line 830 of file btreepic.C.

◆ Token_Type

enum Token_Type
Enumerator
NUMBER 
STRING 
START_PREFIX 
START_INFIX 
START_KEY 
START_AUX 
SHADOW_NODE 
WITHOUT_NODE 
TAG 
ARC 
DASHED_ARC 
SCRATCH 
SPLIT 
KEY 
XOFFSET 
YOFFSET 
TRIANGLE 
TRIANGLEH 
WITHOUT_ARC 
COMMENT 
RECTANGLE 
PARRECTANGLE 
DISTANCE 
LEFT 
RIGHT 
THREAD 
NORTH 
SOUTH 
EAST 
WEST 
NORTH_EAST 
NORTH_WEST 
SOUTH_EAST 
SOUTH_WEST 
END_FILE 
INVALID 

Definition at line 165 of file btreepic.C.

Function Documentation

◆ adjust_size_by_tags()

void adjust_size_by_tags ( EepicNode< long > *  root,
const size_t &  height 
)

Definition at line 1378 of file btreepic.C.

References east_offset(), h_size, hr, north_offset(), resolution, root(), south_offset(), v_size, vr, and west_offset().

Referenced by set_picture_size().

◆ assign_arcs()

◆ assign_aux()

void assign_aux ( EepicNode< long > *  p,
int  ,
const int  position 
)

Definition at line 845 of file btreepic.C.

References AUX, and aux_print_dynarray.

Referenced by build_tree().

◆ assign_distance()

void assign_distance ( EepicNode< long > *  p,
int  ,
const int  position 
)

◆ assign_external_nodes()

void assign_external_nodes ( EepicNode< long > *  p)

Definition at line 970 of file btreepic.C.

References assign_external_nodes(), EXTERNAL, l, Aleph::LLINK(), and Aleph::RLINK().

Referenced by assign_external_nodes(), and build_tree().

◆ assign_key()

void assign_key ( EepicNode< long > *  p,
int  ,
const int  position 
)

Definition at line 840 of file btreepic.C.

References key_print_dynarray, and STRING.

Referenced by build_tree().

◆ assign_parrectangle()

void assign_parrectangle ( EepicNode< long > *  p,
int  ,
const int  position 
)

◆ assign_pos_and_level()

void assign_pos_and_level ( EepicNode< long > *  p,
const int  level,
const int  position 
)

Definition at line 1090 of file btreepic.C.

References h, hr, INFIXPOS, LEVEL, vr, w, X, and Y.

Referenced by build_tree().

◆ assign_rectangle()

void assign_rectangle ( EepicNode< long > *  p,
int  ,
const int  position 
)

◆ assign_scratch()

void assign_scratch ( EepicNode< long > *  p,
int  ,
const int  position 
)

Definition at line 989 of file btreepic.C.

References Aleph::maps(), SCRATCH, scratch_dynarray, and Aleph::DynArray< T >::size().

Referenced by build_tree().

◆ assign_shadow()

void assign_shadow ( EepicNode< long > *  p,
int  ,
const int  position 
)

Definition at line 850 of file btreepic.C.

References Aleph::maps(), SHADOW, shadow_dynarray, Aleph::DynArray< T >::size(), and WITHOUT.

Referenced by build_tree().

◆ assign_tag()

void assign_tag ( EepicNode< long > *  p,
int  ,
const int  position 
)

Definition at line 876 of file btreepic.C.

References Aleph::maps(), Aleph::DynArray< T >::size(), tag_data_dynarray, tag_pos_dynarray, and TAGLIST.

Referenced by build_tree().

◆ assign_triangle()

void assign_triangle ( EepicNode< long > *  p,
int  ,
const int  position 
)

◆ assign_without_arc()

void assign_without_arc ( EepicNode< long > *  p,
int  ,
const int  position 
)

Definition at line 1076 of file btreepic.C.

References Aleph::maps(), Aleph::DynArray< T >::size(), WITHARC, and without_arc_dynarray.

Referenced by build_tree().

◆ assign_without_node()

void assign_without_node ( EepicNode< long > *  p,
int  ,
const int  position 
)

Definition at line 869 of file btreepic.C.

References Aleph::maps(), Aleph::DynArray< T >::size(), WITHOUT, and without_node_dynarray.

Referenced by build_tree().

◆ assign_xoffset()

void assign_xoffset ( EepicNode< long > *  p,
int  ,
const int  position 
)

◆ assign_yoffset()

void assign_yoffset ( EepicNode< long > *  p,
int  ,
const int  position 
)

◆ build_tree()

EepicNode< long > * build_tree ( )

Definition at line 1435 of file btreepic.C.

References AH_ERROR, assign_arcs(), assign_aux(), assign_distance(), assign_external_nodes(), assign_key(), assign_parrectangle(), assign_pos_and_level(), assign_rectangle(), assign_scratch(), assign_shadow(), assign_tag(), assign_triangle(), assign_without_arc(), assign_without_node(), assign_xoffset(), assign_yoffset(), aux_print_dynarray, compute_picture_size(), Aleph::DynArray< T >::cut(), dash_threaded_trees, distance_dynarray, fill_type, fit_mode, height_parrectangle_dynarray, height_rectangle_dynarray, height_triangle_dynarray, infix_dynarray, Aleph::inOrderRec(), key_pos_dynarray, key_print_dynarray, key_string_dynarray, Aleph::maps(), num_nodes, pos_distance_dynarray, pos_parrectangle_dynarray, pos_rectangle_dynarray, pos_triangle_dynarray, pos_xoffset_dynarray, pos_yoffset_dynarray, prefix_dynarray, Aleph::preOrderRec(), reassign_key(), root(), scratch_dynarray, set_picture_size(), shadow_dynarray, Aleph::DynArray< T >::size(), source_arc_dynarray, tag_data_dynarray, tag_pos_dynarray, target_arc_dynarray, thread_tree(), threaded_trees, with_external_nodes, with_string_aux, with_string_key, without_arc_dynarray, without_node_dynarray, xoffset_dynarray, and yoffset_dynarray.

Referenced by build_tree(), Aleph::Find_Depth_First_Spanning_Tree< GT, SA >::build_tree(), Aleph::Find_Depth_First_Spanning_Tree< GT, SA >::build_tree(), main(), Aleph::Find_Depth_First_Spanning_Tree< GT, SA >::operator()(), Aleph::Find_Breadth_First_Spanning_Tree< GT, SA >::operator()(), Aleph::Find_Depth_First_Spanning_Tree< GT, SA >::operator()(), and Aleph::Find_Breadth_First_Spanning_Tree< GT, SA >::operator()().

◆ compute_picture_size()

void compute_picture_size ( EepicNode< long > *  p)
inline

Definition at line 1421 of file btreepic.C.

References Aleph::computeHeightRec(), h, h_size, hd, hr, num_nodes, resolution, v_size, vd, vr, and w.

Referenced by build_tree().

◆ east_offset()

bool east_offset ( EepicNode< long > *  root)
inline

Definition at line 1311 of file btreepic.C.

References EAST, Aleph::find_max(), Aleph::maps(), NORTH_EAST, root(), SOUTH_EAST, and TAGLIST.

Referenced by adjust_size_by_tags().

◆ file_to_dynarrays()

◆ generate_epilogue()

void generate_epilogue ( ofstream &  output)

Definition at line 1660 of file btreepic.C.

References latex_header, Aleph::maps(), and output.

Referenced by main().

◆ generate_prologue()

void generate_prologue ( ofstream &  output)

◆ generate_split_lines()

void generate_split_lines ( ofstream &  output,
EepicNode< long > *  root 
)
inline

◆ generate_tree()

◆ get_token()

◆ load_arc_option()

void load_arc_option ( ifstream &  input_stream,
const Token_Type token_type 
)

◆ load_distance_option()

◆ load_key_option()

void load_key_option ( ifstream &  input_stream)

◆ load_offset_option()

void load_offset_option ( ifstream &  input_stream,
DynArray< long > &  positions,
DynArray< long double > &  offsets 
)

Definition at line 579 of file btreepic.C.

References DYNARRAY_APPEND, Aleph::load_number(), and Aleph::maps().

Referenced by file_to_dynarrays().

◆ load_parrectangle_option()

void load_parrectangle_option ( ifstream &  input_stream)

◆ load_rectangle_option()

void load_rectangle_option ( ifstream &  input_stream)

◆ load_split_option()

void load_split_option ( ifstream &  input_stream)

◆ load_tag_option()

void load_tag_option ( ifstream &  input_stream)

◆ load_thread_option()

void load_thread_option ( ifstream &  input_stream)

◆ load_triangle_option()

void load_triangle_option ( ifstream &  input_stream)

◆ load_triangleh_option()

void load_triangleh_option ( ifstream &  input_stream)

◆ main()

◆ north_offset()

bool north_offset ( EepicNode< long > *  p)
inline

Definition at line 1293 of file btreepic.C.

References Aleph::maps(), NORTH, NORTH_EAST, NORTH_WEST, and TAGLIST.

Referenced by adjust_size_by_tags().

◆ print_parameters()

void print_parameters ( )
inline

Definition at line 2198 of file btreepic.C.

References h, h_size, hd, hr, Aleph::maps(), resolution, v_size, vd, vr, w, x_aux_offset, x_offset, x_picture_offset, y_aux_offset, y_offset, and y_picture_offset.

Referenced by main().

◆ read_parameters()

void read_parameters ( )
inline

◆ reassign_key()

void reassign_key ( EepicNode< long > *  p,
int  ,
const int  position 
)

Definition at line 860 of file btreepic.C.

References key_pos_dynarray, key_string_dynarray, Aleph::maps(), Aleph::DynArray< T >::size(), and STRING.

Referenced by build_tree().

◆ save_parameters()

void save_parameters ( )
inline

◆ select()

template<class Node >
Node * select ( Node root,
const int &  i 
)
inline

Definition at line 902 of file btreepic.C.

References INFIXPOS, Aleph::LLINK(), Aleph::RLINK(), and root().

Referenced by assign_arcs(), and generate_split_lines().

◆ set_picture_size()

void set_picture_size ( EepicNode< long > *  p)
inline

◆ south_offset()

bool south_offset ( EepicNode< long > *  root,
const size_t &  level 
)
inline

◆ thread_tree()

void thread_tree ( EepicNode< long > *  p)
inline

Definition at line 1099 of file btreepic.C.

References Aleph::LLINK(), PREV, Aleph::RLINK(), SUCC, and thread_tree().

Referenced by build_tree(), and thread_tree().

◆ west_offset()

bool west_offset ( EepicNode< long > *  root)
inline

Definition at line 1331 of file btreepic.C.

References Aleph::find_min(), Aleph::maps(), NORTH_WEST, root(), SOUTH_WEST, TAGLIST, and WEST.

Referenced by adjust_size_by_tags().

Variable Documentation

◆ argp_program_version

const char* argp_program_version
Initial value:
=
"btreepic 1.9.6\n"
"ALEPH drawer for binary trees\n"
"Copyright (C) 2007 UNIVERSITY of LOS ANDES (ULA)\n"
"Merida - REPUBLICA BOLIVARIANA DE VENEZUELA\n"
"Center of Studies in Microelectronics & Distributed Systems (CEMISID)\n"
"ULA Computer Science Department\n"
"This is free software; There is NO warranty; not even for MERCHANTABILITY\n"
"or FITNESS FOR A PARTICULAR PURPOSE\n"
"\n"

Definition at line 2138 of file btreepic.C.

Referenced by main().

◆ aux_print_dynarray

DynArray<string> aux_print_dynarray

Definition at line 457 of file btreepic.C.

Referenced by assign_aux(), build_tree(), and file_to_dynarrays().

◆ command_line

string command_line

Definition at line 403 of file btreepic.C.

Referenced by Aleph::command_line_to_string(), generate_prologue(), and main().

◆ dash_threaded_trees

bool dash_threaded_trees = false

Definition at line 423 of file btreepic.C.

Referenced by build_tree(), generate_prologue(), generate_tree(), generate_tree(), and main().

◆ distance_dynarray

DynArray<Line_Distance_Data> distance_dynarray

Definition at line 503 of file btreepic.C.

Referenced by assign_distance(), build_tree(), and load_distance_option().

◆ draw_node_mode

bool draw_node_mode = true

Definition at line 418 of file btreepic.C.

◆ draw_nodes

bool draw_nodes = true

Definition at line 425 of file btreepic.C.

Referenced by generate_tree(), and main().

◆ fit_mode

bool fit_mode = false

Definition at line 417 of file btreepic.C.

Referenced by build_tree(), and main().

◆ h

long double h = 35

Definition at line 154 of file btreepic.C.

Referenced by Aleph::ArrayHeap< T, Compare >::ArrayHeap(), Aleph::ArrayHeap< T, Compare >::ArrayHeap(), Aleph::DynBinHeap< T, Compare >::DynBinHeap(), Aleph::DynBinHeap< T, Compare >::DynBinHeap(), Aleph::DynArrayHeap< T, Compare >::Iterator::Iterator(), Aleph::GenBinHeap< NodeType, Key, Compare >::Iterator::Iterator(), Aleph::add_hash(), Aleph::add_hash(), assign_pos_and_level(), Aleph::Gen_Avl_Tree_Rk< NodeType, Key, Compare >::avl_height(), Aleph::Gen_Rb_Tree_Rk< NodeType, Key, Compare >::black_height(), build_network_graph(), compute_mid_point_line(), Aleph::AStar_Min_Path< GT, Distance, Heuristic, Itor, SA, HeapT >::compute_partial_path(), compute_picture_size(), demo_practical(), demo_simple_bloom_filter(), deway(), Aleph::djb_hash(), Aleph::djb_hash(), Aleph::elf_hash(), Aleph::elf_hash(), __gmp_jn_function::eval(), __gmp_yn_function::eval(), __gmp_binary_plus::eval(), __gmp_binary_minus::eval(), __gmp_binary_multiplies::eval(), __gmp_binary_divides::eval(), __gmp_dim_function::eval(), __gmp_pow_function::eval(), __gmp_atan2_function::eval(), __gmp_agm_function::eval(), __gmp_max_function::eval(), __gmp_min_function::eval(), __gmp_hypot_function::eval(), __gmp_remainder_function::eval(), __gmp_pow_function::eval(), __gmp_pow_function::eval(), example_basic_all_pairs(), Aleph::fmix32(), Aleph::fnv_hash(), Aleph::fnv_hash(), Aleph::gen_random_euclidian_graph(), generate_tree(), generate_tree(), hexadecimalize(), Aleph::hlpp_maximum_flow(), Aleph::jsw_hash(), Aleph::jsw_hash(), load_triangle_option(), main(), Aleph::oat_hash(), Aleph::oat_hash(), Aleph::ArrayHeap< T, Compare >::operator=(), Aleph::ArrayHeap< T, Compare >::operator=(), Aleph::DynBinHeap< T, Compare >::operator=(), Aleph::DynBinHeap< T, Compare >::operator=(), Aleph::AStar_Min_Path< GT, Distance, Heuristic, Itor, SA, HeapT >::paint_partial_path(), print_parameters(), read_parameters(), Aleph::rot_hash(), Aleph::rot_hash(), run_modern_example(), save_parameters(), Aleph::sax_hash(), Aleph::sax_hash(), scenario_pnl_dashboard(), set_picture_size(), Aleph::shellsort(), Aleph::ArrayHeap< T, Compare >::swap(), Aleph::GenBinHeap< NodeType, Key, Compare >::swap(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), RandomTreeTest::tree_height(), TYPED_TEST(), unhexadecimalize(), Aleph::xor_hash(), and Aleph::xor_hash().

◆ h_size

◆ hd

◆ height_parrectangle_dynarray

DynArray<long double> height_parrectangle_dynarray

Definition at line 498 of file btreepic.C.

Referenced by assign_parrectangle(), build_tree(), and load_parrectangle_option().

◆ height_rectangle_dynarray

DynArray<long double> height_rectangle_dynarray

Definition at line 494 of file btreepic.C.

Referenced by assign_rectangle(), build_tree(), and load_rectangle_option().

◆ height_triangle_dynarray

DynArray<long double> height_triangle_dynarray

◆ hello

auto hello
static
Initial value:
=
"\n"
"ALEPH drawer for binary trees\n"
"Copyright (C) 2007, 2006, 2005, 2004, 2003, 2002 University of Los Andes (ULA)\n"
"Merida - REPUBLICA BOLIVARIANA DE VENEZUELA\n"
"Center of Studies in Microelectronics & Distributed Systems (CEMISID)\n"
"ULA Computer Science Department\n"
"This is free software; There is NO warranty; not even for MERCHANTABILITY\n"
"or FITNESS FOR A PARTICULAR PURPOSE\n"
"\n"

Definition at line 2149 of file btreepic.C.

Referenced by main().

◆ hr

◆ infix_dynarray

DynArray<long> infix_dynarray

Definition at line 455 of file btreepic.C.

Referenced by build_tree(), and file_to_dynarrays().

◆ input_file_name

string input_file_name

Definition at line 406 of file btreepic.C.

Referenced by file_to_dynarrays(), generate_prologue(), and main().

◆ key_pos_dynarray

DynArray<long> key_pos_dynarray

Definition at line 478 of file btreepic.C.

Referenced by build_tree(), load_key_option(), and reassign_key().

◆ key_print_dynarray

DynArray<string> key_print_dynarray

Definition at line 456 of file btreepic.C.

Referenced by assign_key(), build_tree(), and file_to_dynarrays().

◆ key_string_dynarray

DynArray<string> key_string_dynarray

Definition at line 479 of file btreepic.C.

Referenced by build_tree(), load_key_option(), and reassign_key().

◆ landscape

bool landscape = false

Definition at line 416 of file btreepic.C.

Referenced by generate_prologue(), and main().

◆ latex_header

bool latex_header = false

Definition at line 415 of file btreepic.C.

Referenced by generate_epilogue(), generate_prologue(), and main().

◆ license_text

constexpr char license_text[]
staticconstexpr

Definition at line 2160 of file btreepic.C.

Referenced by main().

◆ max_num_nodes_rectangle

int max_num_nodes_rectangle = 0

Definition at line 602 of file btreepic.C.

Referenced by load_parrectangle_option(), load_rectangle_option(), and set_picture_size().

◆ num_nodes

◆ output_file_name

string output_file_name

Definition at line 407 of file btreepic.C.

Referenced by generate_prologue(), and main().

◆ parameters_file_name

const char* parameters_file_name = "./.btreepic"

Definition at line 427 of file btreepic.C.

Referenced by read_parameters(), and save_parameters().

◆ pos_distance_dynarray

DynArray<long> pos_distance_dynarray

Definition at line 502 of file btreepic.C.

Referenced by assign_distance(), build_tree(), and load_distance_option().

◆ pos_parrectangle_dynarray

DynArray<long> pos_parrectangle_dynarray

Definition at line 499 of file btreepic.C.

Referenced by assign_parrectangle(), build_tree(), and load_parrectangle_option().

◆ pos_rectangle_dynarray

DynArray<long> pos_rectangle_dynarray

Definition at line 495 of file btreepic.C.

Referenced by assign_rectangle(), build_tree(), and load_rectangle_option().

◆ pos_triangle_dynarray

DynArray<long> pos_triangle_dynarray

◆ pos_xoffset_dynarray

DynArray<long> pos_xoffset_dynarray

Definition at line 482 of file btreepic.C.

Referenced by assign_xoffset(), build_tree(), and file_to_dynarrays().

◆ pos_yoffset_dynarray

DynArray<long> pos_yoffset_dynarray

Definition at line 486 of file btreepic.C.

Referenced by assign_yoffset(), build_tree(), and file_to_dynarrays().

◆ prefix_dynarray

DynArray<long> prefix_dynarray

Definition at line 454 of file btreepic.C.

Referenced by build_tree(), file_to_dynarrays(), and load_key_option().

◆ printing_key_mode

bool printing_key_mode = false

Definition at line 419 of file btreepic.C.

Referenced by file_to_dynarrays(), generate_tree(), and main().

◆ scratch_dynarray

DynArray<long> scratch_dynarray

Definition at line 472 of file btreepic.C.

Referenced by assign_scratch(), build_tree(), and file_to_dynarrays().

◆ shadow_dynarray

DynArray<long> shadow_dynarray

Definition at line 458 of file btreepic.C.

Referenced by assign_shadow(), build_tree(), and file_to_dynarrays().

◆ silent_mode

bool silent_mode = true

Definition at line 414 of file btreepic.C.

Referenced by file_to_dynarrays(), and main().

◆ source_arc_dynarray

DynArray<long> source_arc_dynarray

Definition at line 464 of file btreepic.C.

Referenced by assign_arcs(), build_tree(), and load_arc_option().

◆ source_thread_dynarray

DynArray<long> source_thread_dynarray

Definition at line 468 of file btreepic.C.

Referenced by assign_arcs(), and load_thread_option().

◆ split_dynarray

DynArray<long> split_dynarray

Definition at line 474 of file btreepic.C.

Referenced by generate_split_lines(), and load_split_option().

◆ split_string_dynarray

DynArray<Split_Data> split_string_dynarray

Definition at line 476 of file btreepic.C.

Referenced by generate_split_lines(), and load_split_option().

◆ tag_data_dynarray

DynArray<Tag_Data> tag_data_dynarray

Definition at line 462 of file btreepic.C.

Referenced by assign_tag(), build_tree(), and load_tag_option().

◆ tag_pos_dynarray

DynArray<long> tag_pos_dynarray

Definition at line 463 of file btreepic.C.

Referenced by assign_tag(), build_tree(), and load_tag_option().

◆ target_arc_dynarray

DynArray<Arc_Data> target_arc_dynarray

Definition at line 466 of file btreepic.C.

Referenced by assign_arcs(), build_tree(), and load_arc_option().

◆ target_thread_dynarray

DynArray<Thread_Data> target_thread_dynarray

Definition at line 470 of file btreepic.C.

Referenced by assign_arcs(), and load_thread_option().

◆ threaded_trees

bool threaded_trees = false

Definition at line 422 of file btreepic.C.

Referenced by build_tree(), and main().

◆ v_size

◆ vd

◆ verbose_mode

bool verbose_mode = true

Definition at line 413 of file btreepic.C.

◆ vr

◆ w

long double w = 20

Definition at line 153 of file btreepic.C.

Referenced by __gmp_set_expr(), assign_pos_and_level(), bar(), Aleph::Tarjan_Connected_Components< GT, Itor, SA >::build_cycle(), build_random_graph(), compute_picture_size(), JohnsonTest::computeFloydWarshall(), Aleph::Fibonacci_Heap< T, Compare >::consolidate(), demo_assignment_problem(), demo_basic(), demo_spell_checker(), __gmp_binary_plus::eval(), __gmp_binary_minus::eval(), __gmp_binary_multiplies::eval(), __gmp_binary_divides::eval(), __gmp_binary_modulus::eval(), __gmp_rand_function::eval(), __gmp_unary_plus::eval(), __gmp_unary_minus::eval(), __gmp_unary_com::eval(), __gmp_abs_function::eval(), __gmp_sqrt_function::eval(), __gmp_binary_plus::eval(), __gmp_binary_minus::eval(), __gmp_binary_multiplies::eval(), __gmp_binary_divides::eval(), __gmp_binary_modulus::eval(), __gmp_ternary_addmul::eval(), __gmp_ternary_submul::eval(), __gmp_binary_plus::eval(), __gmp_binary_minus::eval(), __gmp_binary_multiplies::eval(), __gmp_binary_divides::eval(), __gmp_binary_modulus::eval(), __gmp_binary_and::eval(), __gmp_binary_ior::eval(), __gmp_binary_xor::eval(), __gmp_ternary_addmul::eval(), __gmp_ternary_submul::eval(), __gmp_ternary_addmul::eval(), __gmp_ternary_submul::eval(), __gmp_ternary_addmul::eval(), __gmp_ternary_submul::eval(), __gmp_ternary_addmul::eval(), __gmp_ternary_submul::eval(), __gmp_binary_plus::eval(), __gmp_binary_minus::eval(), __gmp_binary_multiplies::eval(), __gmp_binary_divides::eval(), __gmp_binary_modulus::eval(), __gmp_ternary_addmul::eval(), __gmp_ternary_submul::eval(), __gmp_binary_plus::eval(), __gmp_binary_minus::eval(), __gmp_binary_multiplies::eval(), __gmp_binary_divides::eval(), __gmp_binary_modulus::eval(), __gmp_binary_lshift::eval(), __gmp_binary_rshift::eval(), __gmp_ternary_addmul::eval(), __gmp_ternary_submul::eval(), __gmp_binary_plus::eval(), __gmp_binary_minus::eval(), __gmp_binary_multiplies::eval(), __gmp_binary_divides::eval(), __gmp_binary_modulus::eval(), __gmp_binary_plus::eval(), __gmp_binary_minus::eval(), __gmp_binary_multiplies::eval(), __gmp_binary_divides::eval(), __gmp_binary_modulus::eval(), __gmp_binary_equal::eval(), __gmp_binary_not_equal::eval(), __gmp_binary_less::eval(), __gmp_binary_less_equal::eval(), __gmp_binary_greater::eval(), __gmp_binary_greater_equal::eval(), __gmp_cmp_function::eval(), Aleph::gen_random_euclidian_graph(), generate_tree(), Aleph::Tarjan_Connected_Components< GT, Itor, SA >::has_cycle(), Aleph::increase_flow(), Aleph::Stoer_Wagner_Min_Cut< GT, Distance, SA >::init_from_graph(), Aleph::Tarjan_Connected_Components< GT, Itor, SA >::is_connected(), main(), mpq_set_mpfr(), mpz_set_mpfr(), print_parameters(), Aleph::Cnode::print_words(), read_parameters(), Aleph::Bellman_Ford< GT, Distance, Ait, NAit, SA >::relax_arcs(), Aleph::Bellman_Ford< GT, Distance, Ait, NAit, SA >::relax_arcs(), Aleph::Johnson< GT, Distance, Ait, NAit, SA >::reweight_arcs(), save_parameters(), Aleph::Tarjan_Connected_Components< GT, Itor, SA >::scc_by_blocks(), Aleph::Tarjan_Connected_Components< GT, Itor, SA >::scc_by_len(), Aleph::Tarjan_Connected_Components< GT, Itor, SA >::scc_by_lists(), scenario_order_book(), set_picture_size(), DoubleDistance::set_weight(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), TEST_F(), and test_sliding_window().

◆ with_external_nodes

bool with_external_nodes = false

Definition at line 424 of file btreepic.C.

Referenced by build_tree(), and main().

◆ with_string_aux

bool with_string_aux = false

Definition at line 421 of file btreepic.C.

Referenced by build_tree(), file_to_dynarrays(), and generate_tree().

◆ with_string_key

bool with_string_key = false

Definition at line 420 of file btreepic.C.

Referenced by build_tree(), and file_to_dynarrays().

◆ without_arc_dynarray

DynArray<long> without_arc_dynarray

Definition at line 505 of file btreepic.C.

Referenced by assign_without_arc(), build_tree(), and file_to_dynarrays().

◆ without_node_dynarray

DynArray<long> without_node_dynarray

Definition at line 460 of file btreepic.C.

Referenced by assign_without_node(), build_tree(), and file_to_dynarrays().

◆ x_aux_offset

long double x_aux_offset = 0

Definition at line 159 of file btreepic.C.

Referenced by generate_tree(), main(), print_parameters(), read_parameters(), and save_parameters().

◆ x_offset

long double x_offset = 0

Definition at line 157 of file btreepic.C.

Referenced by generate_tree(), main(), print_parameters(), read_parameters(), and save_parameters().

◆ x_picture_offset

long double x_picture_offset = 0

◆ xoffset_dynarray

DynArray<long double> xoffset_dynarray

Definition at line 483 of file btreepic.C.

Referenced by assign_xoffset(), build_tree(), and file_to_dynarrays().

◆ y_aux_offset

long double y_aux_offset = 0

Definition at line 160 of file btreepic.C.

Referenced by generate_tree(), main(), print_parameters(), read_parameters(), and save_parameters().

◆ y_offset

long double y_offset = 0

Definition at line 158 of file btreepic.C.

Referenced by generate_tree(), main(), print_parameters(), read_parameters(), and save_parameters().

◆ y_picture_offset

long double y_picture_offset = 0

◆ yoffset_dynarray

DynArray<long double> yoffset_dynarray

Definition at line 487 of file btreepic.C.

Referenced by assign_yoffset(), build_tree(), and file_to_dynarrays().