COIN-OR::LEMON - Graph Library

Changeset 544:ccd2d3a3001e in lemon-1.2 for test


Ignore:
Timestamp:
02/25/09 12:10:52 (15 years ago)
Author:
Alpar Juttner <alpar@…>
Branch:
default
Phase:
public
Message:

Cut iterators for GomoryHuTree? + doc cleanup + bug fixes (#66)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • test/gomory_hu_test.cc

    r543 r544  
    33#include "test_tools.h"
    44#include <lemon/smart_graph.h>
    5 #include <lemon/adaptors.h>
    65#include <lemon/lgf_reader.h>
    7 #include <lemon/lgf_writer.h>
    8 #include <lemon/dimacs.h>
    9 #include <lemon/time_measure.h>
    106#include <lemon/gomory_hu_tree.h>
    117#include <cstdlib>
     
    7874      check(cm[u] != cm[v], "Wrong cut 3");
    7975      check(pf.flowValue() == cutValue(graph, cm, capacity), "Wrong cut 2");
     76
     77      int sum=0;
     78      for(GomoryHuTree<Graph>::MinCutEdgeIt a(ght, u, v);a!=INVALID;++a)
     79        sum+=capacity[a];
     80      check(sum == ght.minCutValue(u, v), "Problem with MinCutEdgeIt");
     81
     82      sum=0;
     83      for(GomoryHuTree<Graph>::MinCutNodeIt n(ght, u, v,true);n!=INVALID;++n)
     84        sum++;
     85      for(GomoryHuTree<Graph>::MinCutNodeIt n(ght, u, v,false);n!=INVALID;++n)
     86        sum++;
     87      check(sum == countNodes(graph), "Problem with MinCutNodeIt");
    8088     
    8189    }
Note: See TracChangeset for help on using the changeset viewer.