equal
deleted
inserted
replaced
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 |
220 } |
220 } |
221 |
221 |
222 void initFlowTest() |
222 void initFlowTest() |
223 { |
223 { |
224 DIGRAPH_TYPEDEFS(SmartDigraph); |
224 DIGRAPH_TYPEDEFS(SmartDigraph); |
225 |
225 |
226 SmartDigraph g; |
226 SmartDigraph g; |
227 SmartDigraph::ArcMap<int> cap(g),iflow(g); |
227 SmartDigraph::ArcMap<int> cap(g),iflow(g); |
228 Node s=g.addNode(); Node t=g.addNode(); |
228 Node s=g.addNode(); Node t=g.addNode(); |
229 Node n1=g.addNode(); Node n2=g.addNode(); |
229 Node n1=g.addNode(); Node n2=g.addNode(); |
230 Arc a; |
230 Arc a; |
380 typedef Preflow<SmartDigraph, SmartDigraph::ArcMap<int> > PType1; |
380 typedef Preflow<SmartDigraph, SmartDigraph::ArcMap<int> > PType1; |
381 typedef Preflow<SmartDigraph, SmartDigraph::ArcMap<float> > PType2; |
381 typedef Preflow<SmartDigraph, SmartDigraph::ArcMap<float> > PType2; |
382 checkMaxFlowAlg<PType1, PreflowStartFunctions<PType1> >(); |
382 checkMaxFlowAlg<PType1, PreflowStartFunctions<PType1> >(); |
383 checkMaxFlowAlg<PType2, PreflowStartFunctions<PType2> >(); |
383 checkMaxFlowAlg<PType2, PreflowStartFunctions<PType2> >(); |
384 initFlowTest(); |
384 initFlowTest(); |
385 |
385 |
386 // Check EdmondsKarp |
386 // Check EdmondsKarp |
387 typedef EdmondsKarp<SmartDigraph, SmartDigraph::ArcMap<int> > EKType1; |
387 typedef EdmondsKarp<SmartDigraph, SmartDigraph::ArcMap<int> > EKType1; |
388 typedef EdmondsKarp<SmartDigraph, SmartDigraph::ArcMap<float> > EKType2; |
388 typedef EdmondsKarp<SmartDigraph, SmartDigraph::ArcMap<float> > EKType2; |
389 checkMaxFlowAlg<EKType1, GeneralStartFunctions<EKType1> >(); |
389 checkMaxFlowAlg<EKType1, GeneralStartFunctions<EKType1> >(); |
390 checkMaxFlowAlg<EKType2, GeneralStartFunctions<EKType2> >(); |
390 checkMaxFlowAlg<EKType2, GeneralStartFunctions<EKType2> >(); |
391 |
391 |
392 initFlowTest(); |
392 initFlowTest(); |
393 |
393 |
394 return 0; |
394 return 0; |
395 } |
395 } |