Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
testAllTree.C File Reference
#include <iostream>
#include <aleph.H>
#include <tpl_binTree.H>
#include <tpl_avl.H>
#include <tpl_treap.H>
#include <tpl_splay_tree.H>
#include <tpl_rb_tree.H>
#include <tpl_rand_tree.H>
#include <tpl_dynMapTree.H>
#include <ran_array.h>
#include <ctime>
#include <gsl/gsl_rng.h>
#include <argp.h>
Include dependency graph for testAllTree.C:

Go to the source code of this file.

Classes

struct  Parameters
 

Enumerations

enum  TreeType {
  INVALID , BIN , AVL , SPLAY ,
  TREAP , RB , RAND , BIN ,
  AVL , AVL_RK , SPLAY , SPLAY_RK ,
  TREAP , TREAP_RK , RB , RB_RK ,
  TD_RB , TD_RB_RK , RAND
}
 

Functions

template<class Node >
static void printNode (Node *node, int, int)
 
template<template< typename, class > class TreeType>
void test (unsigned long n, gsl_rng *r)
 
static error_t parser_opt (int key, char *, struct argp_state *state)
 
int main (int argc, char *argv[])
 

Variables

const char * argp_program_version = "testAllTree 0.0"
 
const char * argp_program_bug_address = "aleph-bugs@aleph.ula.ve"
 
static char doc [] = "testAllTree -- A tester for all binary trees"
 
static char argDoc [] = "-n num_nodes -m seed_for_random -<tree type>\n"
 
static struct argp_option options []
 
static struct argp argDefs = { options, parser_opt, argDoc, doc, 0, 0, 0 }
 

Enumeration Type Documentation

◆ TreeType

enum TreeType
Enumerator
INVALID 
BIN 
AVL 
SPLAY 
TREAP 
RB 
RAND 
BIN 
AVL 
AVL_RK 
SPLAY 
SPLAY_RK 
TREAP 
TREAP_RK 
RB 
RB_RK 
TD_RB 
TD_RB_RK 
RAND 

Definition at line 113 of file testAllTree.C.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

◆ parser_opt()

static error_t parser_opt ( int  key,
char *  ,
struct argp_state *  state 
)
static

Definition at line 154 of file testAllTree.C.

References AVL, BIN, Aleph::divide_and_conquer_partition_dp(), INVALID, RAND, RB, SPLAY, and TREAP.

◆ printNode()

template<class Node >
static void printNode ( Node node,
int  ,
int   
)
static

Definition at line 44 of file testAllTree.C.

◆ test()

Variable Documentation

◆ argDefs

struct argp argDefs = { options, parser_opt, argDoc, doc, 0, 0, 0 }
static

Definition at line 211 of file testAllTree.C.

Referenced by main().

◆ argDoc

char argDoc[] = "-n num_nodes -m seed_for_random -<tree type>\n"
static

Definition at line 137 of file testAllTree.C.

◆ argp_program_bug_address

const char* argp_program_bug_address = "aleph-bugs@aleph.ula.ve"

Definition at line 134 of file testAllTree.C.

◆ argp_program_version

const char* argp_program_version = "testAllTree 0.0"

Definition at line 133 of file testAllTree.C.

◆ doc

char doc[] = "testAllTree -- A tester for all binary trees"
static

Definition at line 136 of file testAllTree.C.

◆ options

struct argp_option options[]
static
Initial value:
= {
{ "bin", 'b', 0, OPTION_ARG_OPTIONAL, "pure binary tree" , 0},
{ "avl", 'a', 0, OPTION_ARG_OPTIONAL, "avl tree" , 0},
{ "splay", 's', 0, OPTION_ARG_OPTIONAL, "splay tree" , 0},
{ "redblack", 'r', 0, OPTION_ARG_OPTIONAL, "red black tree" , 0},
{ "rand", 'd', 0, OPTION_ARG_OPTIONAL, "randomized tree" , 0},
{ "treap", 'p', 0, OPTION_ARG_OPTIONAL, "treap tree" , 0},
{ "nodes", 'n', "num_nodes", OPTION_ARG_OPTIONAL,
"Specify the number of nodes to be generated", 0 },
{ "seed", 'm', "seed_for_random", OPTION_ARG_OPTIONAL,
"Specify the seed for randon number generator", 0},
{ 0, 0, 0, 0, 0, 0 }
}
Divide_Conquer_DP_Result< Cost > divide_and_conquer_partition_dp(const size_t groups, const size_t n, Transition_Cost_Fn transition_cost, const Cost inf=dp_optimization_detail::default_inf< Cost >())
Optimize partition DP using divide-and-conquer optimization.

Definition at line 140 of file testAllTree.C.