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

Tests for Tree_DP.H. More...

#include <gtest/gtest.h>
#include <limits>
#include <random>
#include <utility>
#include <Tree_DP.H>
Include dependency graph for tree_dp_test.cc:

Go to the source code of this file.

Typedefs

using G = List_Graph< Graph_Node< int >, Graph_Arc< int > >
 

Functions

static G build_path (size_t n, Array< G::Node * > &nodes)
 
static G build_star (size_t n, Array< G::Node * > &nodes)
 
 TEST (TreeDP, SubtreeSizes_Path)
 
 TEST (TreeDP, SubtreeSizes_Star)
 
 TEST (TreeDP, SubtreeSizes_SingleNode)
 
 TEST (TreeDP, MaxDistance_Path)
 
 TEST (TreeDP, MaxDistance_Star)
 
 TEST (TreeDP, SumOfDistances_Path)
 
 TEST (TreeDP, NotATree)
 
 TEST (TreeDP, DisconnectedGraph)
 
 TEST (TreeDP, RootNotInGraph)
 
 TEST (TreeDP, ParallelEdgesAreIgnored)
 
 TEST (TreeDP, BinaryTree)
 
 TEST (TreeDP, RandomSumOfDistancesVsBfs)
 

Detailed Description

Tests for Tree_DP.H.

Definition in file tree_dp_test.cc.

Typedef Documentation

◆ G

using G = List_Graph<Graph_Node<int>, Graph_Arc<int> >

Definition at line 47 of file tree_dp_test.cc.

Function Documentation

◆ build_path()

static G build_path ( size_t  n,
Array< G::Node * > &  nodes 
)
static

◆ build_star()

static G build_star ( size_t  n,
Array< G::Node * > &  nodes 
)
static

◆ TEST() [1/12]

◆ TEST() [2/12]

◆ TEST() [3/12]

TEST ( TreeDP  ,
MaxDistance_Path   
)

◆ TEST() [4/12]

TEST ( TreeDP  ,
MaxDistance_Star   
)

Definition at line 205 of file tree_dp_test.cc.

References build_star(), Aleph::divide_and_conquer_partition_dp(), and nodes.

◆ TEST() [5/12]

◆ TEST() [6/12]

◆ TEST() [7/12]

◆ TEST() [8/12]

◆ TEST() [9/12]

TEST ( TreeDP  ,
SubtreeSizes_Path   
)

◆ TEST() [10/12]

TEST ( TreeDP  ,
SubtreeSizes_SingleNode   
)

◆ TEST() [11/12]

TEST ( TreeDP  ,
SubtreeSizes_Star   
)

Definition at line 150 of file tree_dp_test.cc.

References build_star(), Aleph::divide_and_conquer_partition_dp(), and nodes.

◆ TEST() [12/12]

TEST ( TreeDP  ,
SumOfDistances_Path   
)