<div dir="ltr"><div>I am trying to do a simple test of the matching algorithm.</div><div><br></div><div>It works fine with ListGraph::EdgeMap<int> weight(G);</div><div><br></div><div>But, if I change this to ListGraph::EdgeMap<double> weight(G), I get the following compiler error:</div><div><br></div><div>/u/magala/cpp/lemon/tkegraph/src/lemoncpp.cpp(53): error: no instance of constructor "lemon::MaxWeightedPerfectMatching<GR, WM>::MaxWeightedPerfectMatching [with GR=lemon::ListGraph, WM=lemon::GraphExtender<lemon::ListGraphBase>::EdgeMap<int>]" matches the argument list</div><div>            argument types are: (lemon::ListGraph, lemon::GraphExtender<lemon::ListGraphBase>::EdgeMap<double>)</div><div>     MaxWeightedPerfectMatching<ListGraph> mwpm(G, weight);</div><div>  </div><div><br></div><div>Here is the full code:</div><div><br></div><div><div>int LemonC::CreateGraph(const int      nNodes,</div><div>                        const int64_t  nLinks,</div><div>                        const int    * linkO,</div><div>                        const int    * linkD,</div><div>                        const double * linkWt){   </div><div>   TEMPLATE_GRAPH_TYPEDEFS(ListGraph);</div><div>   cout << "hello test lemon create graph" << endl;</div><div>   ListGraph G;</div><div>   ListGraph::EdgeMap<double> weight(G);</div><div>   //ListGraph::EdgeMap<int> weight(G);</div><div>   ListGraph::Edge e;</div><div>   ListGraph::Node n[10000];</div><div>   G.reserveNode(nNodes);</div><div>   G.reserveEdge(nLinks);</div><div>   int64_t i;</div><div>   for(i = 0; i < nNodes; i++){<br></div><div>      n[i] = G.addNode();</div><div>   }</div><div>   for(i = 0; i < nLinks; i++){</div><div>      e = G.addEdge(n[linkO[i]], n[linkD[i]]);</div><div>      weight[e] = linkWt[i];</div><div>   }</div><div><br></div><div>   MaxWeightedPerfectMatching<ListGraph> mwpm(G, weight);</div><div>   bool result = mwpm.run();</div><div>   cout << "Matching weight = " << mwpm.matchingWeight() << endl;</div><div><br></div><div>   return 1;</div><div>}</div></div><div><br></div></div>