|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Tests for Gen_Segment_Tree, Lazy variants, and Segment_Tree_Beats. More...
#include <gtest/gtest.h>#include <tpl_segment_tree.H>#include <algorithm>#include <cstddef>#include <numeric>#include <random>#include <utility>#include <vector>Go to the source code of this file.
Functions | |
| TEST (GenSegmentTree, EmptyConstruction) | |
| TEST (GenSegmentTree, UniformConstruction) | |
| TEST (GenSegmentTree, SumAgainstBruteForce) | |
| TEST (GenSegmentTree, MinAgainstBruteForce) | |
| TEST (GenSegmentTree, MaxAgainstBruteForce) | |
| TEST (GenSegmentTree, PointUpdate) | |
| TEST (GenSegmentTree, SetValue) | |
| TEST (GenSegmentTree, ConstructorsAllContainers) | |
| TEST (GenSegmentTree, CustomXorMonoid) | |
| TEST (GenSegmentTree, CustomGcdMonoid) | |
| TEST (GenSegmentTree, CopyMoveSwap) | |
| TEST (GenSegmentTree, BoundsChecking) | |
| TEST (GenSegmentTree, OneElement) | |
| TEST (GenSegmentTree, TwoElements) | |
| TEST (GenSegmentTree, Values) | |
| TEST (GenSegmentTree, StressRandomSumUpdates) | |
| TEST (GenSegmentTree, StressRandomMinUpdates) | |
| TEST (SegmentTreeTypedefs, SumSegmentTree) | |
| TEST (SegmentTreeTypedefs, MinSegmentTree) | |
| TEST (SegmentTreeTypedefs, MaxSegmentTree) | |
| TEST (SegmentTreeTypedefs, DoubleSum) | |
| TEST (LazySegmentTree, EmptyConstruction) | |
| TEST (LazySegmentTree, RangeUpdateSum) | |
| TEST (LazySegmentTree, OverlappingRangeUpdates) | |
| TEST (LazySegmentTree, PointUpdate) | |
| TEST (LazySegmentTree, SetValue) | |
| TEST (LazySegmentTree, ConstructorsAllContainers) | |
| TEST (LazySegmentTree, CopyMoveSwap) | |
| TEST (LazySegmentTree, BoundsChecking) | |
| TEST (LazySegmentTree, OneElement) | |
| TEST (LazySegmentTree, StressRandom) | |
| TEST (LazyPolicies, AddMin) | |
| TEST (LazyPolicies, AddMax) | |
| TEST (LazyPolicies, AssignSum) | |
| TEST (LazyPolicies, AddMinStress) | |
| TEST (SegmentTreeBeats, EmptyConstruction) | |
| TEST (SegmentTreeBeats, BasicChmin) | |
| TEST (SegmentTreeBeats, BasicChmax) | |
| TEST (SegmentTreeBeats, InterleavedChminChmax) | |
| TEST (SegmentTreeBeats, SumAfterOps) | |
| TEST (SegmentTreeBeats, OneElement) | |
| TEST (SegmentTreeBeats, CopyMoveSwap) | |
| TEST (SegmentTreeBeats, BoundsChecking) | |
| TEST (SegmentTreeBeats, StressBruteForce) | |
| TEST (SegmentTreeBeats, Values) | |
Tests for Gen_Segment_Tree, Lazy variants, and Segment_Tree_Beats.
Definition in file tpl_segment_tree_test.cc.
| TEST | ( | GenSegmentTree | , |
| BoundsChecking | |||
| ) |
| TEST | ( | GenSegmentTree | , |
| ConstructorsAllContainers | |||
| ) |
Definition at line 175 of file tpl_segment_tree_test.cc.
References Aleph::Array< T >::append(), Aleph::DynList< T >::append(), brute_sum(), Aleph::divide_and_conquer_partition_dp(), l, r, and Aleph::HTList::size().
| TEST | ( | GenSegmentTree | , |
| CopyMoveSwap | |||
| ) |
Definition at line 232 of file tpl_segment_tree_test.cc.
References Aleph::copy(), Aleph::divide_and_conquer_partition_dp(), and Aleph::Gen_Segment_Tree< T, Op >::swap().
| TEST | ( | GenSegmentTree | , |
| CustomGcdMonoid | |||
| ) |
Definition at line 222 of file tpl_segment_tree_test.cc.
References Aleph::divide_and_conquer_partition_dp().
| TEST | ( | GenSegmentTree | , |
| CustomXorMonoid | |||
| ) |
Definition at line 204 of file tpl_segment_tree_test.cc.
References Aleph::divide_and_conquer_partition_dp().
| TEST | ( | GenSegmentTree | , |
| EmptyConstruction | |||
| ) |
| TEST | ( | GenSegmentTree | , |
| MaxAgainstBruteForce | |||
| ) |
Definition at line 142 of file tpl_segment_tree_test.cc.
References brute_max(), Aleph::divide_and_conquer_partition_dp(), l, Aleph::Gen_Segment_Tree< T, Op >::query(), r, and Aleph::HTList::size().
| TEST | ( | GenSegmentTree | , |
| MinAgainstBruteForce | |||
| ) |
Definition at line 132 of file tpl_segment_tree_test.cc.
References brute_min(), Aleph::divide_and_conquer_partition_dp(), l, Aleph::Gen_Segment_Tree< T, Op >::query(), r, and Aleph::HTList::size().
| TEST | ( | GenSegmentTree | , |
| OneElement | |||
| ) |
Definition at line 265 of file tpl_segment_tree_test.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Segment_Tree< T, Op >::get(), Aleph::Gen_Segment_Tree< T, Op >::query(), Aleph::Gen_Segment_Tree< T, Op >::set(), Aleph::Gen_Segment_Tree< T, Op >::size(), and Aleph::Gen_Segment_Tree< T, Op >::update().
| TEST | ( | GenSegmentTree | , |
| PointUpdate | |||
| ) |
Definition at line 152 of file tpl_segment_tree_test.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Segment_Tree< T, Op >::get(), Aleph::Gen_Segment_Tree< T, Op >::query(), and Aleph::Gen_Segment_Tree< T, Op >::update().
| TEST | ( | GenSegmentTree | , |
| SetValue | |||
| ) |
Definition at line 162 of file tpl_segment_tree_test.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Segment_Tree< T, Op >::get(), Aleph::Gen_Segment_Tree< T, Op >::query(), and Aleph::Gen_Segment_Tree< T, Op >::set().
| TEST | ( | GenSegmentTree | , |
| StressRandomMinUpdates | |||
| ) |
Definition at line 341 of file tpl_segment_tree_test.cc.
References brute_min(), Aleph::divide_and_conquer_partition_dp(), N, Aleph::Gen_Segment_Tree< T, Op >::query(), rng, and Aleph::Gen_Segment_Tree< T, Op >::set().
| TEST | ( | GenSegmentTree | , |
| StressRandomSumUpdates | |||
| ) |
Definition at line 305 of file tpl_segment_tree_test.cc.
References brute_sum(), Aleph::divide_and_conquer_partition_dp(), N, Aleph::Gen_Segment_Tree< T, Op >::query(), rng, and Aleph::Gen_Segment_Tree< T, Op >::update().
| TEST | ( | GenSegmentTree | , |
| SumAgainstBruteForce | |||
| ) |
Definition at line 122 of file tpl_segment_tree_test.cc.
References brute_sum(), Aleph::divide_and_conquer_partition_dp(), l, Aleph::Gen_Segment_Tree< T, Op >::query(), r, and Aleph::HTList::size().
| TEST | ( | GenSegmentTree | , |
| TwoElements | |||
| ) |
Definition at line 280 of file tpl_segment_tree_test.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Segment_Tree< T, Op >::query(), and Aleph::Gen_Segment_Tree< T, Op >::set().
| TEST | ( | GenSegmentTree | , |
| UniformConstruction | |||
| ) |
| TEST | ( | GenSegmentTree | , |
| Values | |||
| ) |
Definition at line 292 of file tpl_segment_tree_test.cc.
References Aleph::divide_and_conquer_partition_dp(), and Aleph::Gen_Segment_Tree< T, Op >::values().
| TEST | ( | LazyPolicies | , |
| AddMax | |||
| ) |
Definition at line 591 of file tpl_segment_tree_test.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Lazy_Segment_Tree< Policy >::query(), and Aleph::Gen_Lazy_Segment_Tree< Policy >::update().
| TEST | ( | LazyPolicies | , |
| AddMin | |||
| ) |
Definition at line 581 of file tpl_segment_tree_test.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Lazy_Segment_Tree< Policy >::query(), and Aleph::Gen_Lazy_Segment_Tree< Policy >::update().
| TEST | ( | LazyPolicies | , |
| AddMinStress | |||
| ) |
Definition at line 619 of file tpl_segment_tree_test.cc.
References brute_min(), Aleph::divide_and_conquer_partition_dp(), N, Aleph::Gen_Lazy_Segment_Tree< Policy >::query(), rng, and Aleph::Gen_Lazy_Segment_Tree< Policy >::update().
| TEST | ( | LazyPolicies | , |
| AssignSum | |||
| ) |
Definition at line 601 of file tpl_segment_tree_test.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Lazy_Segment_Tree< Policy >::get(), Aleph::Gen_Lazy_Segment_Tree< Policy >::query(), and Aleph::Gen_Lazy_Segment_Tree< Policy >::update().
| TEST | ( | LazySegmentTree | , |
| BoundsChecking | |||
| ) |
Definition at line 524 of file tpl_segment_tree_test.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Lazy_Segment_Tree< Policy >::query(), Aleph::Gen_Lazy_Segment_Tree< Policy >::set(), and Aleph::Gen_Lazy_Segment_Tree< Policy >::update().
| TEST | ( | LazySegmentTree | , |
| ConstructorsAllContainers | |||
| ) |
Definition at line 476 of file tpl_segment_tree_test.cc.
References Aleph::Array< T >::append(), Aleph::DynList< T >::append(), brute_sum(), Aleph::divide_and_conquer_partition_dp(), l, r, and Aleph::HTList::size().
| TEST | ( | LazySegmentTree | , |
| CopyMoveSwap | |||
| ) |
Definition at line 505 of file tpl_segment_tree_test.cc.
References Aleph::copy(), Aleph::divide_and_conquer_partition_dp(), and Aleph::Gen_Lazy_Segment_Tree< Policy >::swap().
| TEST | ( | LazySegmentTree | , |
| EmptyConstruction | |||
| ) |
| TEST | ( | LazySegmentTree | , |
| OneElement | |||
| ) |
Definition at line 534 of file tpl_segment_tree_test.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Lazy_Segment_Tree< Policy >::get(), Aleph::Gen_Lazy_Segment_Tree< Policy >::set(), and Aleph::Gen_Lazy_Segment_Tree< Policy >::update().
| TEST | ( | LazySegmentTree | , |
| OverlappingRangeUpdates | |||
| ) |
Definition at line 441 of file tpl_segment_tree_test.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Lazy_Segment_Tree< Policy >::get(), Aleph::Gen_Lazy_Segment_Tree< Policy >::query(), and Aleph::Gen_Lazy_Segment_Tree< Policy >::update().
| TEST | ( | LazySegmentTree | , |
| PointUpdate | |||
| ) |
| TEST | ( | LazySegmentTree | , |
| RangeUpdateSum | |||
| ) |
Definition at line 428 of file tpl_segment_tree_test.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Lazy_Segment_Tree< Policy >::get(), Aleph::Gen_Lazy_Segment_Tree< Policy >::query(), and Aleph::Gen_Lazy_Segment_Tree< Policy >::update().
| TEST | ( | LazySegmentTree | , |
| SetValue | |||
| ) |
Definition at line 467 of file tpl_segment_tree_test.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Lazy_Segment_Tree< Policy >::get(), Aleph::Gen_Lazy_Segment_Tree< Policy >::query(), and Aleph::Gen_Lazy_Segment_Tree< Policy >::set().
| TEST | ( | LazySegmentTree | , |
| StressRandom | |||
| ) |
Definition at line 545 of file tpl_segment_tree_test.cc.
References brute_sum(), Aleph::divide_and_conquer_partition_dp(), N, Aleph::Gen_Lazy_Segment_Tree< Policy >::query(), rng, and Aleph::Gen_Lazy_Segment_Tree< Policy >::update().
| TEST | ( | SegmentTreeBeats | , |
| BasicChmax | |||
| ) |
| TEST | ( | SegmentTreeBeats | , |
| BasicChmin | |||
| ) |
| TEST | ( | SegmentTreeBeats | , |
| BoundsChecking | |||
| ) |
Definition at line 743 of file tpl_segment_tree_test.cc.
References Aleph::Segment_Tree_Beats< T >::chmax(), Aleph::Segment_Tree_Beats< T >::chmin(), Aleph::divide_and_conquer_partition_dp(), and Aleph::Segment_Tree_Beats< T >::query_sum().
| TEST | ( | SegmentTreeBeats | , |
| CopyMoveSwap | |||
| ) |
Definition at line 724 of file tpl_segment_tree_test.cc.
References Aleph::copy(), Aleph::divide_and_conquer_partition_dp(), and Aleph::Segment_Tree_Beats< T >::swap().
| TEST | ( | SegmentTreeBeats | , |
| EmptyConstruction | |||
| ) |
Definition at line 655 of file tpl_segment_tree_test.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Segment_Tree_Beats< T >::is_empty(), Aleph::Segment_Tree_Beats< T >::query_sum(), and Aleph::Segment_Tree_Beats< T >::size().
| TEST | ( | SegmentTreeBeats | , |
| InterleavedChminChmax | |||
| ) |
Definition at line 686 of file tpl_segment_tree_test.cc.
References Aleph::Segment_Tree_Beats< T >::chmax(), Aleph::Segment_Tree_Beats< T >::chmin(), Aleph::divide_and_conquer_partition_dp(), Aleph::Segment_Tree_Beats< T >::query_max(), Aleph::Segment_Tree_Beats< T >::query_min(), and Aleph::Segment_Tree_Beats< T >::query_sum().
| TEST | ( | SegmentTreeBeats | , |
| OneElement | |||
| ) |
Definition at line 709 of file tpl_segment_tree_test.cc.
References Aleph::Segment_Tree_Beats< T >::chmax(), Aleph::Segment_Tree_Beats< T >::chmin(), Aleph::divide_and_conquer_partition_dp(), Aleph::Segment_Tree_Beats< T >::get(), Aleph::Segment_Tree_Beats< T >::query_max(), Aleph::Segment_Tree_Beats< T >::query_min(), and Aleph::Segment_Tree_Beats< T >::query_sum().
| TEST | ( | SegmentTreeBeats | , |
| StressBruteForce | |||
| ) |
Definition at line 752 of file tpl_segment_tree_test.cc.
References brute_max(), brute_min(), brute_sum(), Aleph::Segment_Tree_Beats< T >::chmax(), Aleph::Segment_Tree_Beats< T >::chmin(), Aleph::divide_and_conquer_partition_dp(), Aleph::Segment_Tree_Beats< T >::get(), N, Aleph::Segment_Tree_Beats< T >::query_max(), Aleph::Segment_Tree_Beats< T >::query_min(), Aleph::Segment_Tree_Beats< T >::query_sum(), and rng.
| TEST | ( | SegmentTreeBeats | , |
| SumAfterOps | |||
| ) |
Definition at line 698 of file tpl_segment_tree_test.cc.
References Aleph::Segment_Tree_Beats< T >::chmax(), Aleph::Segment_Tree_Beats< T >::chmin(), Aleph::divide_and_conquer_partition_dp(), and Aleph::Segment_Tree_Beats< T >::query_sum().
| TEST | ( | SegmentTreeBeats | , |
| Values | |||
| ) |
Definition at line 811 of file tpl_segment_tree_test.cc.
References Aleph::Segment_Tree_Beats< T >::chmin(), Aleph::divide_and_conquer_partition_dp(), and Aleph::Segment_Tree_Beats< T >::values().
| TEST | ( | SegmentTreeTypedefs | , |
| DoubleSum | |||
| ) |
Definition at line 407 of file tpl_segment_tree_test.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Segment_Tree< T, Op >::query(), and Aleph::Gen_Segment_Tree< T, Op >::update().
| TEST | ( | SegmentTreeTypedefs | , |
| MaxSegmentTree | |||
| ) |
Definition at line 398 of file tpl_segment_tree_test.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Segment_Tree< T, Op >::query(), and Aleph::Gen_Segment_Tree< T, Op >::set().
| TEST | ( | SegmentTreeTypedefs | , |
| MinSegmentTree | |||
| ) |
Definition at line 389 of file tpl_segment_tree_test.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Segment_Tree< T, Op >::query(), and Aleph::Gen_Segment_Tree< T, Op >::set().
| TEST | ( | SegmentTreeTypedefs | , |
| SumSegmentTree | |||
| ) |
Definition at line 381 of file tpl_segment_tree_test.cc.
References Aleph::divide_and_conquer_partition_dp(), Aleph::Gen_Segment_Tree< T, Op >::query(), and Aleph::Gen_Segment_Tree< T, Op >::update().