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

The contract matrix of the tree algorithms: every template of LCA.H, HLD.H, Tree_Decomposition.H and Tree_DP.H with every kind of graph, arc filter and constness that it takes. More...

#include <algorithm>
#include <cstdlib>
#include <set>
#include <stdexcept>
#include <type_traits>
#include <utility>
#include <vector>
#include <gtest/gtest.h>
#include <tpl_graph.H>
#include <LCA.H>
#include <HLD.H>
#include <Tree_Decomposition.H>
#include <Tree_DP.H>
#include "graph_harness.H"
#include "graph_filter_catalog.H"
#include "graph_contract_matrix.H"
Include dependency graph for graph_contract_matrix_trees_test.cc:

Go to the source code of this file.

Classes

class  ContractTreesLca< GT >
 
class  ContractTreesHld< GT >
 
class  ContractTreesDecomposition< GT >
 
class  ContractTreesDp< GT >
 

Functions

 TYPED_TEST_SUITE (ContractTreesLca, Undirected_Kinds)
 
 TYPED_TEST (ContractTreesLca, BinaryLifting)
 
 TYPED_TEST (ContractTreesLca, EulerRmq)
 
 TYPED_TEST_SUITE (ContractTreesHld, Undirected_Kinds)
 
 TYPED_TEST (ContractTreesHld, GenHld)
 
 TYPED_TEST (ContractTreesHld, SumMaxAndMin)
 
 TYPED_TEST_SUITE (ContractTreesDecomposition, Undirected_Kinds)
 
 TYPED_TEST (ContractTreesDecomposition, HeavyLight)
 
 TYPED_TEST (ContractTreesDecomposition, PathQuery)
 
 TYPED_TEST (ContractTreesDecomposition, Centroid)
 
 TYPED_TEST_SUITE (ContractTreesDp, Undirected_Kinds)
 
 TYPED_TEST (ContractTreesDp, SubtreeSizes)
 
 TYPED_TEST (ContractTreesDp, Rerooting)
 
 TYPED_TEST (ContractTreesDp, Functions)
 

Detailed Description

The contract matrix of the tree algorithms: every template of LCA.H, HLD.H, Tree_Decomposition.H and Tree_DP.H with every kind of graph, arc filter and constness that it takes.

The tree algorithms take the three kinds of graph that are not directed, and a filter that cuts a tree out of a larger graph. Each test builds one template with each of those kinds and each filter of graph_filter_catalog.H and Dft_Show_Arc, on a graph as it is and as a const graph, and calls each of its entry points once:

  • on a triangle with a tail, which is the path 0 - 1 - 2 - 3 only without arc 2: with a filter that hides it, the answers are those of the path, and with Dft_Show_Arc the construction rejects the cycle, so that a filter that is not applied shows up;
  • on the path 0 - 1 - 2, a tree for every filter, since it has no arc 2.

All the combinations compile. graph_contract_compile_check.cmake checks that a predicate on nodes, which is not an arc filter, does not (lca_node_filter).

Definition in file graph_contract_matrix_trees_test.cc.

Function Documentation

◆ TYPED_TEST() [1/10]

TYPED_TEST ( ContractTreesDecomposition  ,
Centroid   
)

Definition at line 479 of file graph_contract_matrix_trees_test.cc.

References chain(), and Aleph::size().

◆ TYPED_TEST() [2/10]

TYPED_TEST ( ContractTreesDecomposition  ,
HeavyLight   
)

Definition at line 385 of file graph_contract_matrix_trees_test.cc.

References r, and Aleph::size().

◆ TYPED_TEST() [3/10]

TYPED_TEST ( ContractTreesDecomposition  ,
PathQuery   
)

Definition at line 439 of file graph_contract_matrix_trees_test.cc.

References Aleph::size().

◆ TYPED_TEST() [4/10]

◆ TYPED_TEST() [5/10]

TYPED_TEST ( ContractTreesDp  ,
Rerooting   
)

Definition at line 595 of file graph_contract_matrix_trees_test.cc.

References Aleph::size().

◆ TYPED_TEST() [6/10]

TYPED_TEST ( ContractTreesDp  ,
SubtreeSizes   
)

Definition at line 571 of file graph_contract_matrix_trees_test.cc.

References Aleph::size().

◆ TYPED_TEST() [7/10]

TYPED_TEST ( ContractTreesHld  ,
GenHld   
)

Definition at line 269 of file graph_contract_matrix_trees_test.cc.

References Aleph::size().

◆ TYPED_TEST() [8/10]

TYPED_TEST ( ContractTreesHld  ,
SumMaxAndMin   
)

Definition at line 324 of file graph_contract_matrix_trees_test.cc.

References Aleph::size().

◆ TYPED_TEST() [9/10]

TYPED_TEST ( ContractTreesLca  ,
BinaryLifting   
)

Definition at line 212 of file graph_contract_matrix_trees_test.cc.

References Aleph::size().

◆ TYPED_TEST() [10/10]

TYPED_TEST ( ContractTreesLca  ,
EulerRmq   
)

Definition at line 238 of file graph_contract_matrix_trees_test.cc.

References Aleph::size().

◆ TYPED_TEST_SUITE() [1/4]

TYPED_TEST_SUITE ( ContractTreesDecomposition  ,
Undirected_Kinds   
)

◆ TYPED_TEST_SUITE() [2/4]

TYPED_TEST_SUITE ( ContractTreesDp  ,
Undirected_Kinds   
)

◆ TYPED_TEST_SUITE() [3/4]

TYPED_TEST_SUITE ( ContractTreesHld  ,
Undirected_Kinds   
)

◆ TYPED_TEST_SUITE() [4/4]

TYPED_TEST_SUITE ( ContractTreesLca  ,
Undirected_Kinds   
)