marci@890: // Use a DIMACS max flow file as stdin. marci@890: // const_map_time < dimacs_max_flow_file marci@890: marci@890: #include marci@890: marci@890: #include marci@890: #include marci@890: #include marci@890: #include marci@890: #include marci@890: marci@890: using namespace hugo; marci@890: marci@890: int main() { marci@890: marci@890: typedef SmartGraph Graph; marci@890: typedef Graph::Node Node; marci@890: typedef Graph::Edge Edge; marci@890: typedef Graph::EdgeIt EdgeIt; marci@890: marci@890: Graph g; marci@890: marci@890: Node s, t; marci@890: NullMap cap; marci@890: readDimacs(std::cin, g, cap, s, t); marci@890: //typedef ConstMap > CN1; CN1 cn1; marci@890: typedef ConstMap CN1; CN1 cn1; marci@890: typedef ConstMap CN2; CN2 cn2(true); marci@890: // typedef ConstMap > CE1; CE1 ce1; marci@890: typedef ConstMap CE1; CE1 ce1; marci@890: typedef ConstMap CE2; CE2 ce2(true); marci@890: typedef SubGraphWrapper SB1; SB1 sb1(g, cn1, ce1); marci@890: typedef SubGraphWrapper SB2; SB2 sb2(g, cn2, ce2); marci@890: Timer ts; marci@890: cout << "specialized (compile-time) const map time:" << endl; marci@890: ts.reset(); marci@890: for (SB1::NodeIt n(sb1); n!=INVALID; ++n) marci@890: for (SB1::EdgeIt e(sb1); e!=INVALID; ++e) { } marci@890: cout << ts << endl; marci@890: ts.reset(); marci@890: cout << "generic const map time:" << endl; marci@890: for (SB2::NodeIt n(sb2); n!=INVALID; ++n) marci@890: for (SB2::EdgeIt e(sb2); e!=INVALID; ++e) { } marci@890: cout << ts << endl; marci@890: return 0; marci@890: }