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

Numeric contract of Negative_Cycles.H and Howard_Min_Mean_Cycle.H with floating-point weights, checked against an exact oracle. More...

#include <gtest/gtest.h>
#include <gmp.h>
#include <algorithm>
#include <cmath>
#include <functional>
#include <limits>
#include <random>
#include <set>
#include <tuple>
#include <vector>
#include <Howard_Min_Mean_Cycle.H>
#include <Negative_Cycles.H>
#include <tpl_graph.H>
Include dependency graph for negative_cycles_numeric_test.cc:

Go to the source code of this file.

Functions

 TEST (NegativeCyclesNumericTest, DoubleWeightsAgreeWithTheExactOracle)
 
 TEST (NegativeCyclesNumericTest, FloatWeightsAgreeWithTheExactOracle)
 
 TEST (NegativeCyclesNumericTest, LongDoubleWeightsAgreeWithTheExactOracle)
 
 TEST (NegativeCyclesNumericTest, ShortDoubleCyclesAgreeWithTheExactOracle)
 
 TEST (NegativeCyclesNumericTest, ShortFloatCyclesAgreeWithTheExactOracle)
 
 TEST (NegativeCyclesNumericTest, ShortLongDoubleCyclesAgreeWithTheExactOracle)
 
 TEST (NegativeCyclesNumericTest, ShortOptimaSurvivePermutationAndExactScaling)
 
 TEST (NegativeCyclesNumericTest, BoundedSearchIsInvariantUnderScalingByPowersOfTwo)
 
 TEST (NegativeCyclesNumericTest, CertifiedResultsDoNotDependOnArcOrNodeOrder)
 
 TEST (NegativeCyclesNumericTest, ExactUpperBoundBeyondTheRangeIsInfinity)
 
 TEST (NegativeCyclesNumericTest, ExactSumsNearTheLargestFiniteValueStayExact)
 
 TEST (NegativeCyclesNumericTest, TotalsBeyondTheRangeThrowWhateverTheEvaluationMethod)
 

Detailed Description

Numeric contract of Negative_Cycles.H and Howard_Min_Mean_Cycle.H with floating-point weights, checked against an exact oracle.

The oracle enumerates the simple cycles of small graphs and adds their weights as exact rationals (the GMP C interface, so that it does not depend on the C++ ABI of gmpxx). It covers float, double and long double weights, subnormal values, cancellations across three binary scales, arc filters and disconnected components, and checks the invariance of the results under scaling by powers of two, the order of the arcs and the order of the nodes.

Definition in file negative_cycles_numeric_test.cc.

Function Documentation

◆ TEST() [1/12]

TEST ( NegativeCyclesNumericTest  ,
BoundedSearchIsInvariantUnderScalingByPowersOfTwo   
)

Definition at line 626 of file negative_cycles_numeric_test.cc.

References arcs, nodes, and rng.

◆ TEST() [2/12]

TEST ( NegativeCyclesNumericTest  ,
CertifiedResultsDoNotDependOnArcOrNodeOrder   
)

Definition at line 668 of file negative_cycles_numeric_test.cc.

References Aleph::and, arcs, h, nodes, r, rng, and Aleph::shuffle().

◆ TEST() [3/12]

TEST ( NegativeCyclesNumericTest  ,
DoubleWeightsAgreeWithTheExactOracle   
)

Definition at line 548 of file negative_cycles_numeric_test.cc.

◆ TEST() [4/12]

◆ TEST() [5/12]

TEST ( NegativeCyclesNumericTest  ,
ExactUpperBoundBeyondTheRangeIsInfinity   
)

Definition at line 715 of file negative_cycles_numeric_test.cc.

References max().

◆ TEST() [6/12]

TEST ( NegativeCyclesNumericTest  ,
FloatWeightsAgreeWithTheExactOracle   
)

Definition at line 554 of file negative_cycles_numeric_test.cc.

◆ TEST() [7/12]

TEST ( NegativeCyclesNumericTest  ,
LongDoubleWeightsAgreeWithTheExactOracle   
)

Definition at line 560 of file negative_cycles_numeric_test.cc.

◆ TEST() [8/12]

TEST ( NegativeCyclesNumericTest  ,
ShortDoubleCyclesAgreeWithTheExactOracle   
)

Definition at line 566 of file negative_cycles_numeric_test.cc.

◆ TEST() [9/12]

TEST ( NegativeCyclesNumericTest  ,
ShortFloatCyclesAgreeWithTheExactOracle   
)

Definition at line 572 of file negative_cycles_numeric_test.cc.

◆ TEST() [10/12]

TEST ( NegativeCyclesNumericTest  ,
ShortLongDoubleCyclesAgreeWithTheExactOracle   
)

Definition at line 578 of file negative_cycles_numeric_test.cc.

◆ TEST() [11/12]

TEST ( NegativeCyclesNumericTest  ,
ShortOptimaSurvivePermutationAndExactScaling   
)

Definition at line 584 of file negative_cycles_numeric_test.cc.

References arcs, nodes, and rng.

◆ TEST() [12/12]