test/bpgraph_test.cc
changeset 1098 cf6084618b1b
parent 1026 699c7eac2c6d
child 1100 688a55e4c878
equal deleted inserted replaced
5:6aabae7de0d0 6:8ae6502c1c71
     1 /* -*- mode: C++; indent-tabs-mode: nil; -*-
     1 /* -*- mode: C++; indent-tabs-mode: nil; -*-
     2  *
     2  *
     3  * This file is a part of LEMON, a generic C++ optimization library.
     3  * This file is a part of LEMON, a generic C++ optimization library.
     4  *
     4  *
     5  * Copyright (C) 2003-2010
     5  * Copyright (C) 2003-2013
     6  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     6  * Egervary Jeno Kombinatorikus Optimalizalasi Kutatocsoport
     7  * (Egervary Research Group on Combinatorial Optimization, EGRES).
     7  * (Egervary Research Group on Combinatorial Optimization, EGRES).
     8  *
     8  *
     9  * Permission to use, modify and distribute this software is granted
     9  * Permission to use, modify and distribute this software is granted
    10  * provided that this copyright notice appears in all copies. For
    10  * provided that this copyright notice appears in all copies. For
   111 void checkBpGraphErase() {
   111 void checkBpGraphErase() {
   112   TEMPLATE_BPGRAPH_TYPEDEFS(BpGraph);
   112   TEMPLATE_BPGRAPH_TYPEDEFS(BpGraph);
   113 
   113 
   114   BpGraph G;
   114   BpGraph G;
   115   RedNode
   115   RedNode
   116     n1 = G.addRedNode(), n4 = G.addRedNode(); 
   116     n1 = G.addRedNode(), n4 = G.addRedNode();
   117   BlueNode
   117   BlueNode
   118     n2 = G.addBlueNode(), n3 = G.addBlueNode();
   118     n2 = G.addBlueNode(), n3 = G.addBlueNode();
   119   Edge
   119   Edge
   120     e1 = G.addEdge(n1, n2), e2 = G.addEdge(n1, n3),
   120     e1 = G.addEdge(n1, n2), e2 = G.addEdge(n1, n3),
   121     e3 = G.addEdge(n4, n2), e4 = G.addEdge(n4, n3);
   121     e3 = G.addEdge(n4, n2), e4 = G.addEdge(n4, n3);
   159 void checkBpGraphAlter() {
   159 void checkBpGraphAlter() {
   160   TEMPLATE_BPGRAPH_TYPEDEFS(BpGraph);
   160   TEMPLATE_BPGRAPH_TYPEDEFS(BpGraph);
   161 
   161 
   162   BpGraph G;
   162   BpGraph G;
   163   RedNode
   163   RedNode
   164     n1 = G.addRedNode(), n4 = G.addRedNode(); 
   164     n1 = G.addRedNode(), n4 = G.addRedNode();
   165   BlueNode
   165   BlueNode
   166     n2 = G.addBlueNode(), n3 = G.addBlueNode();
   166     n2 = G.addBlueNode(), n3 = G.addBlueNode();
   167   Edge
   167   Edge
   168     e1 = G.addEdge(n1, n2), e2 = G.addEdge(n1, n3),
   168     e1 = G.addEdge(n1, n2), e2 = G.addEdge(n1, n3),
   169     e3 = G.addEdge(n4, n2), e4 = G.addEdge(n4, n3);
   169     e3 = G.addEdge(n4, n2), e4 = G.addEdge(n4, n3);
   214   RedNode
   214   RedNode
   215     n1 = G.addRedNode();
   215     n1 = G.addRedNode();
   216   BlueNode
   216   BlueNode
   217     n2 = G.addBlueNode(),
   217     n2 = G.addBlueNode(),
   218     n3 = G.addBlueNode();
   218     n3 = G.addBlueNode();
   219   Edge 
   219   Edge
   220     e1 = G.addEdge(n1, n2),
   220     e1 = G.addEdge(n1, n2),
   221     e2 = G.addEdge(n1, n3);
   221     e2 = G.addEdge(n1, n3);
   222 
   222 
   223   checkGraphNodeList(G, 3);
   223   checkGraphNodeList(G, 3);
   224   checkGraphRedNodeList(G, 1);
   224   checkGraphRedNodeList(G, 1);