// Use a DIMACS max flow file as stdin.
// const_map_time < dimacs_max_flow_file

#include <iostream>

#include <lemon/maps.h>
#include <lemon/smart_graph.h>
#include <lemon/time_measure.h>
#include <lemon/dimacs.h>
#include <lemon/graph_wrapper.h>

using namespace lemon;

int main() {

  typedef SmartGraph Graph;
  typedef Graph::Node Node;
  typedef Graph::Edge Edge;
  typedef Graph::EdgeIt EdgeIt;

  Graph g;

  Node s, t;
  NullMap<Edge, int> cap;
  readDimacs(std::cin, g, cap, s, t);
  //typedef ConstMap<Node, Bool<true> > CN1; CN1 cn1;
  typedef ConstMap<Node, True> CN1; CN1 cn1;
  typedef ConstMap<Node, bool> CN2; CN2 cn2(true);
  // typedef ConstMap<Edge, Bool<true> > CE1; CE1 ce1;
  typedef ConstMap<Edge, True> CE1; CE1 ce1;
  typedef ConstMap<Edge, bool> CE2; CE2 ce2(true);
  typedef SubGraphWrapper<Graph, CN1, CE1> SB1; SB1 sb1(g, cn1, ce1);
  typedef SubGraphWrapper<Graph, CN2, CE2> SB2; SB2 sb2(g, cn2, ce2);
  Timer ts;
  cout << "specialized (compile-time) const map time:" << endl;
  ts.reset();
  for (SB1::NodeIt n(sb1); n!=INVALID; ++n)
    for (SB1::EdgeIt e(sb1); e!=INVALID; ++e) { }
  cout << ts << endl;
  ts.reset();
  cout << "generic const map time:" << endl;
  for (SB2::NodeIt n(sb2); n!=INVALID; ++n) 
    for (SB2::EdgeIt e(sb2); e!=INVALID; ++e) { }
  cout << ts << endl;
  return 0;
}
