|
Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
|
Tests for Netcapgraph. More...
#include <gtest/gtest.h>#include <random>#include <set>#include <map>#include <string>#include <sstream>#include <cmath>#include <tpl_netcapgraph.H>#include <tpl_net.H>Go to the source code of this file.
Classes | |
| class | NetCapGraphEdgeCases |
| class | NetCapGraphStructure |
| class | NetCapGraphRealistic |
| class | NetCapGraphStress |
| class | NetCapGraphValidation |
| class | NetCapGraphIntegerFlow |
| class | NetCapGraphStringInfo |
| class | NetCapGraphCookies |
| class | NetCapGraphFuzz |
Typedefs | |
| using | DefaultNode = Net_Cap_Node< Empty_Class, double > |
| using | DefaultArc = Net_Arc< Empty_Class, double > |
| using | DefaultNet = Net_Cap_Graph< DefaultNode, DefaultArc > |
| using | IntNode = Net_Cap_Node< int, long > |
| using | IntArc = Net_Arc< int, long > |
| using | IntNet = Net_Cap_Graph< IntNode, IntArc > |
| using | StringNode = Net_Cap_Node< string, double > |
| using | StringArc = Net_Arc< string, double > |
| using | StringNet = Net_Cap_Graph< StringNode, StringArc > |
Functions | |
| TEST_F (NetCapGraphEdgeCases, EmptyNetwork_NoNodes) | |
| TEST_F (NetCapGraphEdgeCases, EmptyNetwork_ComputeAuxNetFails) | |
| TEST_F (NetCapGraphEdgeCases, SingleNode_UnlimitedCapacity) | |
| TEST_F (NetCapGraphEdgeCases, SingleNode_SpecificCapacity) | |
| TEST_F (NetCapGraphEdgeCases, SingleNode_ZeroCapacity) | |
| TEST_F (NetCapGraphEdgeCases, SingleNode_NegativeCapacityThrows) | |
| TEST_F (NetCapGraphEdgeCases, CapacityBoundary_MaxDouble) | |
| TEST_F (NetCapGraphEdgeCases, CapacityBoundary_SmallPositive) | |
| TEST_F (NetCapGraphEdgeCases, CapacityBoundary_Epsilon) | |
| TEST_F (NetCapGraphEdgeCases, Arc_ZeroCapacity) | |
| TEST_F (NetCapGraphEdgeCases, Arc_FlowEqualsCapacity) | |
| TEST_F (NetCapGraphEdgeCases, Arc_FlowExceedsCapacityThrows) | |
| TEST_F (NetCapGraphEdgeCases, AuxNet_DoubleComputeThrows) | |
| TEST_F (NetCapGraphEdgeCases, AuxNet_FreeWithoutComputeThrows) | |
| TEST_F (NetCapGraphEdgeCases, AuxNet_UpdateWithoutComputeThrows) | |
| TEST_F (NetCapGraphEdgeCases, AuxNet_ComputeFreeCycle) | |
| TEST_F (NetCapGraphEdgeCases, CopyConstruction) | |
| TEST_F (NetCapGraphEdgeCases, MoveConstruction) | |
| TEST_F (NetCapGraphStructure, LinearNetwork_ThreeNodes) | |
| TEST_F (NetCapGraphStructure, LinearNetwork_TenNodes) | |
| TEST_F (NetCapGraphStructure, StarNetwork_FiveSpokes) | |
| TEST_F (NetCapGraphStructure, DiamondNetwork) | |
| TEST_F (NetCapGraphStructure, CompleteNetwork_FiveNodes) | |
| TEST_F (NetCapGraphStructure, BipartiteNetwork) | |
| TEST_F (NetCapGraphRealistic, DataCenterNetwork) | |
| TEST_F (NetCapGraphRealistic, WaterDistributionNetwork) | |
| TEST_F (NetCapGraphRealistic, TrafficNetwork) | |
| TEST_F (NetCapGraphStress, LargeRandomNetwork) | |
| TEST_F (NetCapGraphStress, DeepChainNetwork) | |
| TEST_F (NetCapGraphStress, WideNetwork) | |
| TEST_F (NetCapGraphValidation, ResetFlows) | |
| TEST_F (NetCapGraphValidation, CheckNodeCapacities_Valid) | |
| TEST_F (NetCapGraphValidation, CheckNodeCapacities_Invalid) | |
| TEST_F (NetCapGraphValidation, SetNodeCapacity_Valid) | |
| TEST_F (NetCapGraphValidation, SetNodeCapacity_Invalid) | |
| TEST_F (NetCapGraphValidation, SetNodeCapacity_Negative) | |
| TEST_F (NetCapGraphIntegerFlow, BasicOperations) | |
| TEST_F (NetCapGraphIntegerFlow, AuxNetWithIntegers) | |
| TEST_F (NetCapGraphStringInfo, BasicOperations) | |
| TEST_F (NetCapGraphStringInfo, AuxNetWithStrings) | |
| TEST_F (NetCapGraphCookies, NodeToCookieMapping) | |
| TEST_F (NetCapGraphCookies, ArcToCookieMapping) | |
| TEST_F (NetCapGraphFuzz, RandomOperations) | |
| TEST_F (NetCapGraphFuzz, ExtremeCapacityValues) | |
| int | main (int argc, char **argv) |
Tests for Netcapgraph.
Definition in file netcapgraph_test.cc.
| using DefaultArc = Net_Arc<Empty_Class, double> |
Definition at line 56 of file netcapgraph_test.cc.
| using DefaultNet = Net_Cap_Graph<DefaultNode, DefaultArc> |
Definition at line 57 of file netcapgraph_test.cc.
| using DefaultNode = Net_Cap_Node<Empty_Class, double> |
Definition at line 55 of file netcapgraph_test.cc.
Definition at line 60 of file netcapgraph_test.cc.
| using IntNet = Net_Cap_Graph<IntNode, IntArc> |
Definition at line 61 of file netcapgraph_test.cc.
| using IntNode = Net_Cap_Node<int, long> |
Definition at line 59 of file netcapgraph_test.cc.
Definition at line 64 of file netcapgraph_test.cc.
| using StringNet = Net_Cap_Graph<StringNode, StringArc> |
Definition at line 65 of file netcapgraph_test.cc.
| using StringNode = Net_Cap_Node<string, double> |
Definition at line 63 of file netcapgraph_test.cc.
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
Definition at line 1025 of file netcapgraph_test.cc.
References Aleph::maps().
| TEST_F | ( | NetCapGraphCookies | , |
| ArcToCookieMapping | |||
| ) |
Definition at line 892 of file netcapgraph_test.cc.
References ARC_COOKIE, and Aleph::maps().
| TEST_F | ( | NetCapGraphCookies | , |
| NodeToCookieMapping | |||
| ) |
Definition at line 869 of file netcapgraph_test.cc.
References ARC_COOKIE, Aleph::Graph_Anode< Node_Info >::insert_arc(), Aleph::Net_Cap_Graph< NodeT, ArcT >::insert_node(), Aleph::maps(), and NODE_COOKIE.
| TEST_F | ( | NetCapGraphEdgeCases | , |
| Arc_FlowEqualsCapacity | |||
| ) |
Definition at line 171 of file netcapgraph_test.cc.
References Aleph::maps().
| TEST_F | ( | NetCapGraphEdgeCases | , |
| Arc_FlowExceedsCapacityThrows | |||
| ) |
Definition at line 181 of file netcapgraph_test.cc.
References Aleph::maps().
| TEST_F | ( | NetCapGraphEdgeCases | , |
| Arc_ZeroCapacity | |||
| ) |
Definition at line 161 of file netcapgraph_test.cc.
References Aleph::maps().
| TEST_F | ( | NetCapGraphEdgeCases | , |
| AuxNet_ComputeFreeCycle | |||
| ) |
Definition at line 215 of file netcapgraph_test.cc.
References Aleph::maps().
| TEST_F | ( | NetCapGraphEdgeCases | , |
| AuxNet_DoubleComputeThrows | |||
| ) |
Definition at line 193 of file netcapgraph_test.cc.
References Aleph::maps().
| TEST_F | ( | NetCapGraphEdgeCases | , |
| AuxNet_FreeWithoutComputeThrows | |||
| ) |
Definition at line 205 of file netcapgraph_test.cc.
References Aleph::maps().
| TEST_F | ( | NetCapGraphEdgeCases | , |
| AuxNet_UpdateWithoutComputeThrows | |||
| ) |
Definition at line 210 of file netcapgraph_test.cc.
References Aleph::maps().
| TEST_F | ( | NetCapGraphEdgeCases | , |
| CapacityBoundary_Epsilon | |||
| ) |
Definition at line 151 of file netcapgraph_test.cc.
References Aleph::maps().
| TEST_F | ( | NetCapGraphEdgeCases | , |
| CapacityBoundary_MaxDouble | |||
| ) |
Definition at line 139 of file netcapgraph_test.cc.
References Aleph::maps().
| TEST_F | ( | NetCapGraphEdgeCases | , |
| CapacityBoundary_SmallPositive | |||
| ) |
Definition at line 145 of file netcapgraph_test.cc.
References Aleph::maps().
| TEST_F | ( | NetCapGraphEdgeCases | , |
| CopyConstruction | |||
| ) |
Definition at line 235 of file netcapgraph_test.cc.
References Aleph::copy(), and Aleph::maps().
| TEST_F | ( | NetCapGraphEdgeCases | , |
| EmptyNetwork_ComputeAuxNetFails | |||
| ) |
Definition at line 89 of file netcapgraph_test.cc.
References Aleph::maps().
| TEST_F | ( | NetCapGraphEdgeCases | , |
| EmptyNetwork_NoNodes | |||
| ) |
Definition at line 81 of file netcapgraph_test.cc.
References Aleph::maps().
| TEST_F | ( | NetCapGraphEdgeCases | , |
| MoveConstruction | |||
| ) |
Definition at line 248 of file netcapgraph_test.cc.
References Aleph::maps().
| TEST_F | ( | NetCapGraphEdgeCases | , |
| SingleNode_NegativeCapacityThrows | |||
| ) |
Definition at line 130 of file netcapgraph_test.cc.
References Aleph::maps().
| TEST_F | ( | NetCapGraphEdgeCases | , |
| SingleNode_SpecificCapacity | |||
| ) |
Definition at line 116 of file netcapgraph_test.cc.
References Aleph::maps().
| TEST_F | ( | NetCapGraphEdgeCases | , |
| SingleNode_UnlimitedCapacity | |||
| ) |
Definition at line 106 of file netcapgraph_test.cc.
References Aleph::maps().
| TEST_F | ( | NetCapGraphEdgeCases | , |
| SingleNode_ZeroCapacity | |||
| ) |
Definition at line 123 of file netcapgraph_test.cc.
References Aleph::maps().
| TEST_F | ( | NetCapGraphFuzz | , |
| ExtremeCapacityValues | |||
| ) |
Definition at line 988 of file netcapgraph_test.cc.
References Aleph::Net_Cap_Graph< NodeT, ArcT >::compute_aux_net(), Aleph::Net_Cap_Graph< NodeT, ArcT >::free_aux_net(), Aleph::Net_Graph< NodeT, ArcT >::insert_arc(), Aleph::Net_Cap_Graph< NodeT, ArcT >::insert_node(), Aleph::maps(), nodes, and Aleph::Net_Cap_Graph< NodeT, ArcT >::update().
| TEST_F | ( | NetCapGraphFuzz | , |
| RandomOperations | |||
| ) |
Definition at line 927 of file netcapgraph_test.cc.
References Aleph::Net_Cap_Graph< NodeT, ArcT >::compute_aux_net(), Aleph::Net_Cap_Graph< NodeT, ArcT >::free_aux_net(), Aleph::Net_Cap_Graph< NodeT, ArcT >::has_aux_net(), Aleph::Net_Graph< NodeT, ArcT >::insert_arc(), Aleph::Net_Cap_Graph< NodeT, ArcT >::insert_node(), Aleph::maps(), nodes, rng, Aleph::Net_Cap_Graph< NodeT, ArcT >::update(), and GraphCommon< GT, Node, Arc >::vsize().
| TEST_F | ( | NetCapGraphIntegerFlow | , |
| AuxNetWithIntegers | |||
| ) |
Definition at line 814 of file netcapgraph_test.cc.
References Aleph::maps().
| TEST_F | ( | NetCapGraphIntegerFlow | , |
| BasicOperations | |||
| ) |
Definition at line 803 of file netcapgraph_test.cc.
References Aleph::Net_Cap_Graph< NodeT, ArcT >::insert_node(), and Aleph::maps().
| TEST_F | ( | NetCapGraphRealistic | , |
| DataCenterNetwork | |||
| ) |
Definition at line 457 of file netcapgraph_test.cc.
References Aleph::Net_Cap_Graph< NodeT, ArcT >::compute_aux_net(), GraphCommon< GT, Node, Arc >::esize(), Aleph::Net_Cap_Graph< NodeT, ArcT >::free_aux_net(), Aleph::Net_Graph< NodeT, ArcT >::insert_arc(), Aleph::Net_Cap_Graph< NodeT, ArcT >::insert_node(), Aleph::maps(), and GraphCommon< GT, Node, Arc >::vsize().
| TEST_F | ( | NetCapGraphRealistic | , |
| TrafficNetwork | |||
| ) |
Definition at line 546 of file netcapgraph_test.cc.
References Aleph::Net_Cap_Graph< NodeT, ArcT >::compute_aux_net(), GraphCommon< GT, Node, Arc >::esize(), Aleph::Net_Cap_Graph< NodeT, ArcT >::free_aux_net(), Aleph::Net_Graph< NodeT, ArcT >::insert_arc(), Aleph::Net_Cap_Graph< NodeT, ArcT >::insert_node(), Aleph::maps(), and GraphCommon< GT, Node, Arc >::vsize().
| TEST_F | ( | NetCapGraphRealistic | , |
| WaterDistributionNetwork | |||
| ) |
| TEST_F | ( | NetCapGraphStress | , |
| DeepChainNetwork | |||
| ) |
Definition at line 652 of file netcapgraph_test.cc.
References Aleph::Net_Cap_Graph< NodeT, ArcT >::compute_aux_net(), GraphCommon< GT, Node, Arc >::esize(), Aleph::Net_Cap_Graph< NodeT, ArcT >::free_aux_net(), Aleph::Net_Graph< NodeT, ArcT >::insert_arc(), Aleph::Net_Cap_Graph< NodeT, ArcT >::insert_node(), Aleph::maps(), nodes, and GraphCommon< GT, Node, Arc >::vsize().
| TEST_F | ( | NetCapGraphStress | , |
| LargeRandomNetwork | |||
| ) |
Definition at line 604 of file netcapgraph_test.cc.
References Aleph::Net_Cap_Graph< NodeT, ArcT >::compute_aux_net(), StlAlephIterator< SetName >::end(), GraphCommon< GT, Node, Arc >::esize(), Aleph::Net_Cap_Graph< NodeT, ArcT >::free_aux_net(), Aleph::DynList< T >::insert(), Aleph::Net_Graph< NodeT, ArcT >::insert_arc(), Aleph::Net_Cap_Graph< NodeT, ArcT >::insert_node(), Aleph::maps(), nodes, rng, Aleph::Net_Cap_Graph< NodeT, ArcT >::update(), and GraphCommon< GT, Node, Arc >::vsize().
| TEST_F | ( | NetCapGraphStress | , |
| WideNetwork | |||
| ) |
Definition at line 679 of file netcapgraph_test.cc.
References Aleph::Net_Cap_Graph< NodeT, ArcT >::compute_aux_net(), GraphCommon< GT, Node, Arc >::esize(), Aleph::Net_Cap_Graph< NodeT, ArcT >::free_aux_net(), Aleph::Net_Graph< NodeT, ArcT >::insert_arc(), Aleph::Net_Cap_Graph< NodeT, ArcT >::insert_node(), Aleph::maps(), GraphCommon< GT, Node, Arc >::vsize(), and WIDTH.
| TEST_F | ( | NetCapGraphStringInfo | , |
| AuxNetWithStrings | |||
| ) |
Definition at line 847 of file netcapgraph_test.cc.
References Aleph::maps().
| TEST_F | ( | NetCapGraphStringInfo | , |
| BasicOperations | |||
| ) |
Definition at line 836 of file netcapgraph_test.cc.
References Aleph::Net_Cap_Graph< NodeT, ArcT >::insert_node(), and Aleph::maps().
| TEST_F | ( | NetCapGraphStructure | , |
| BipartiteNetwork | |||
| ) |
Definition at line 412 of file netcapgraph_test.cc.
References l, and Aleph::maps().
| TEST_F | ( | NetCapGraphStructure | , |
| CompleteNetwork_FiveNodes | |||
| ) |
Definition at line 387 of file netcapgraph_test.cc.
References Aleph::maps(), and nodes.
| TEST_F | ( | NetCapGraphStructure | , |
| DiamondNetwork | |||
| ) |
Definition at line 353 of file netcapgraph_test.cc.
References Aleph::maps().
| TEST_F | ( | NetCapGraphStructure | , |
| LinearNetwork_TenNodes | |||
| ) |
Definition at line 305 of file netcapgraph_test.cc.
References Aleph::maps(), and nodes.
| TEST_F | ( | NetCapGraphStructure | , |
| LinearNetwork_ThreeNodes | |||
| ) |
Definition at line 278 of file netcapgraph_test.cc.
References Aleph::Graph_Anode< Node_Info >::insert_arc(), Aleph::Net_Cap_Graph< NodeT, ArcT >::insert_node(), and Aleph::maps().
| TEST_F | ( | NetCapGraphStructure | , |
| StarNetwork_FiveSpokes | |||
| ) |
Definition at line 328 of file netcapgraph_test.cc.
References Aleph::maps().
| TEST_F | ( | NetCapGraphValidation | , |
| CheckNodeCapacities_Invalid | |||
| ) |
Definition at line 750 of file netcapgraph_test.cc.
References Aleph::maps().
| TEST_F | ( | NetCapGraphValidation | , |
| CheckNodeCapacities_Valid | |||
| ) |
Definition at line 735 of file netcapgraph_test.cc.
References Aleph::maps().
| TEST_F | ( | NetCapGraphValidation | , |
| ResetFlows | |||
| ) |
Definition at line 717 of file netcapgraph_test.cc.
References Aleph::Graph_Anode< Node_Info >::insert_arc(), Aleph::Net_Cap_Graph< NodeT, ArcT >::insert_node(), and Aleph::maps().
| TEST_F | ( | NetCapGraphValidation | , |
| SetNodeCapacity_Invalid | |||
| ) |
Definition at line 776 of file netcapgraph_test.cc.
References Aleph::maps(), and Aleph::Net_Cap_Graph< DefaultNode, DefaultArc >::set_node_cap().
| TEST_F | ( | NetCapGraphValidation | , |
| SetNodeCapacity_Negative | |||
| ) |
Definition at line 786 of file netcapgraph_test.cc.
References Aleph::maps(), and Aleph::Net_Cap_Graph< DefaultNode, DefaultArc >::set_node_cap().
| TEST_F | ( | NetCapGraphValidation | , |
| SetNodeCapacity_Valid | |||
| ) |
Definition at line 765 of file netcapgraph_test.cc.
References Aleph::maps(), and Aleph::Net_Cap_Graph< DefaultNode, DefaultArc >::set_node_cap().