|
Aleph-w 7.10.0
A C++ Library for Data Structures and Algorithms
|
Tests for LCA.H (binary lifting and Euler tour + RMQ). More...
#include <gtest/gtest.h>#include <algorithm>#include <chrono>#include <cstddef>#include <cstdlib>#include <functional>#include <limits>#include <random>#include <stdexcept>#include <utility>#include <LCA.H>#include <tpl_agraph.H>#include <tpl_array.H>#include <tpl_graph.H>#include <tpl_sgraph.H>#include <htlist.H>#include "test_graph_helpers.h"Go to the source code of this file.
Functions | |
| TYPED_TEST (LcaTypedTest, EmptyTree) | |
| TYPED_TEST (LcaTypedTest, SingleNode) | |
| TYPED_TEST (LcaTypedTest, ManualTreeQueries) | |
| TYPED_TEST (LcaTypedTest, DefaultRootIsFirstNode) | |
| TYPED_TEST (LcaTypedTest, RejectsCycle) | |
| TYPED_TEST (LcaTypedTest, RejectsDisconnectedGraph) | |
| TYPED_TEST (LcaTypedTest, RejectsLoopAndParallelEdges) | |
| TYPED_TEST (LcaTypedTest, ArcFilterSelectsTree) | |
| TYPED_TEST (LcaTypedTest, RejectsNodeFromAnotherGraphAndBadIds) | |
| TYPED_TEST (LcaTypedTest, RandomTreesAgainstNaiveOracle) | |
| TYPED_TEST (LcaTypedTest, PerfRegression) | |
Tests for LCA.H (binary lifting and Euler tour + RMQ).
Coverage:
Definition in file lca_test.cc.
| TYPED_TEST | ( | LcaTypedTest | , |
| ArcFilterSelectsTree | |||
| ) |
Definition at line 445 of file lca_test.cc.
References Aleph::Array< T >::create(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_arc(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), Aleph::Gen_Binary_Lifting_LCA< GT, SA >::lca(), Aleph::Gen_Euler_RMQ_LCA< GT, SA >::lca(), and nodes.
| TYPED_TEST | ( | LcaTypedTest | , |
| DefaultRootIsFirstNode | |||
| ) |
Definition at line 341 of file lca_test.cc.
References Aleph::Array< T >::append(), Aleph::Gen_Binary_Lifting_LCA< GT, SA >::lca(), Aleph::Gen_Euler_RMQ_LCA< GT, SA >::lca(), Aleph::Filter_Iterator< Container, It, Show_Item >::next_ne(), nodes, Aleph::Array< T >::reserve(), Aleph::Gen_Binary_Lifting_LCA< GT, SA >::root(), and Aleph::Gen_Euler_RMQ_LCA< GT, SA >::root().
| TYPED_TEST | ( | LcaTypedTest | , |
| EmptyTree | |||
| ) |
Definition at line 232 of file lca_test.cc.
References Aleph::Gen_Binary_Lifting_LCA< GT, SA >::is_empty(), Aleph::Gen_Euler_RMQ_LCA< GT, SA >::is_empty(), Aleph::Gen_Euler_RMQ_LCA< GT, SA >::lca_id(), Aleph::Gen_Binary_Lifting_LCA< GT, SA >::lca_id(), Aleph::Gen_Binary_Lifting_LCA< GT, SA >::size(), and Aleph::Gen_Euler_RMQ_LCA< GT, SA >::size().
| TYPED_TEST | ( | LcaTypedTest | , |
| ManualTreeQueries | |||
| ) |
Definition at line 279 of file lca_test.cc.
References Aleph::Array< T >::append(), check(), Aleph::Gen_Binary_Lifting_LCA< GT, SA >::distance(), Aleph::Gen_Euler_RMQ_LCA< GT, SA >::distance(), Aleph::Gen_Binary_Lifting_LCA< GT, SA >::is_ancestor(), Aleph::Gen_Euler_RMQ_LCA< GT, SA >::is_ancestor(), Aleph::Gen_Binary_Lifting_LCA< GT, SA >::kth_ancestor(), Aleph::Gen_Binary_Lifting_LCA< GT, SA >::lca(), Aleph::Gen_Euler_RMQ_LCA< GT, SA >::lca(), nodes, and Aleph::Array< T >::reserve().
| TYPED_TEST | ( | LcaTypedTest | , |
| PerfRegression | |||
| ) |
Definition at line 576 of file lca_test.cc.
References Aleph::Gen_Binary_Lifting_LCA< GT, SA >::distance(), Aleph::Gen_Euler_RMQ_LCA< GT, SA >::distance(), Aleph::Gen_Binary_Lifting_LCA< GT, SA >::lca(), Aleph::Gen_Euler_RMQ_LCA< GT, SA >::lca(), nodes, rng, and root().
| TYPED_TEST | ( | LcaTypedTest | , |
| RandomTreesAgainstNaiveOracle | |||
| ) |
Definition at line 508 of file lca_test.cc.
References Aleph::Gen_Binary_Lifting_LCA< GT, SA >::depth_of(), Aleph::Gen_Euler_RMQ_LCA< GT, SA >::depth_of(), Aleph::Gen_Binary_Lifting_LCA< GT, SA >::distance(), Aleph::Gen_Euler_RMQ_LCA< GT, SA >::distance(), Aleph::Gen_Binary_Lifting_LCA< GT, SA >::id_of(), Aleph::Gen_Euler_RMQ_LCA< GT, SA >::id_of(), Aleph::Gen_Binary_Lifting_LCA< GT, SA >::is_ancestor(), Aleph::Gen_Euler_RMQ_LCA< GT, SA >::is_ancestor(), k, Aleph::Gen_Binary_Lifting_LCA< GT, SA >::kth_ancestor(), Aleph::Gen_Binary_Lifting_LCA< GT, SA >::lca(), Aleph::Gen_Euler_RMQ_LCA< GT, SA >::lca(), Aleph::Gen_Binary_Lifting_LCA< GT, SA >::node_of(), Aleph::Gen_Euler_RMQ_LCA< GT, SA >::node_of(), nodes, rng, and root().
| TYPED_TEST | ( | LcaTypedTest | , |
| RejectsCycle | |||
| ) |
Definition at line 384 of file lca_test.cc.
References Aleph::Array< T >::append(), nodes, and Aleph::Array< T >::reserve().
| TYPED_TEST | ( | LcaTypedTest | , |
| RejectsDisconnectedGraph | |||
| ) |
Definition at line 401 of file lca_test.cc.
References Aleph::Array< T >::append(), nodes, and Aleph::Array< T >::reserve().
| TYPED_TEST | ( | LcaTypedTest | , |
| RejectsLoopAndParallelEdges | |||
| ) |
Definition at line 417 of file lca_test.cc.
References Aleph::Array< T >::append(), nodes, and Aleph::Array< T >::reserve().
| TYPED_TEST | ( | LcaTypedTest | , |
| RejectsNodeFromAnotherGraphAndBadIds | |||
| ) |
Definition at line 477 of file lca_test.cc.
References Aleph::Array< T >::append(), Aleph::Gen_Binary_Lifting_LCA< GT, SA >::depth_of(), Aleph::Gen_Euler_RMQ_LCA< GT, SA >::depth_of(), Aleph::Gen_Binary_Lifting_LCA< GT, SA >::lca(), Aleph::Gen_Euler_RMQ_LCA< GT, SA >::lca(), Aleph::Gen_Euler_RMQ_LCA< GT, SA >::lca_id(), Aleph::Gen_Binary_Lifting_LCA< GT, SA >::lca_id(), Aleph::Gen_Binary_Lifting_LCA< GT, SA >::node_of(), Aleph::Gen_Euler_RMQ_LCA< GT, SA >::node_of(), and Aleph::Array< T >::reserve().
| TYPED_TEST | ( | LcaTypedTest | , |
| SingleNode | |||
| ) |
Definition at line 250 of file lca_test.cc.
References Aleph::Gen_Binary_Lifting_LCA< GT, SA >::depth_of(), Aleph::Gen_Euler_RMQ_LCA< GT, SA >::depth_of(), Aleph::Gen_Binary_Lifting_LCA< GT, SA >::distance(), Aleph::Gen_Euler_RMQ_LCA< GT, SA >::distance(), Aleph::List_Graph< _Graph_Node, _Graph_Arc >::insert_node(), Aleph::Gen_Binary_Lifting_LCA< GT, SA >::kth_ancestor(), Aleph::Gen_Binary_Lifting_LCA< GT, SA >::lca(), Aleph::Gen_Euler_RMQ_LCA< GT, SA >::lca(), Aleph::Gen_Binary_Lifting_LCA< GT, SA >::parent_of(), Aleph::Gen_Euler_RMQ_LCA< GT, SA >::parent_of(), Aleph::Gen_Binary_Lifting_LCA< GT, SA >::root(), Aleph::Gen_Euler_RMQ_LCA< GT, SA >::root(), Aleph::Gen_Binary_Lifting_LCA< GT, SA >::size(), and Aleph::Gen_Euler_RMQ_LCA< GT, SA >::size().