边缘权重与柠檬图库

时间:2014-06-29 19:37:59

标签: c++ graph

我正在使用Lemon图库。

我想为边缘分配整数权重。因此我使用EdgeMap。不幸的是我的代码没有编译。

no matching function for call to 'lemon::concepts::Graph::EdgeMap<int>::EdgeMap(lemon::ListGraph&)'

有什么想法吗?

#include <lemon/list_graph.h>
#include <lemon/concepts/graph.h>

#include <iostream>

using namespace lemon;
using namespace std;

int main(int argc, const char * argv[])
{    

   ListGraph g;
   lemon::concepts::Graph::EdgeMap<int> map(g);

   return 0;
}

1 个答案:

答案 0 :(得分:0)

看起来你正试图在这里调用禁止的拷贝构造函数。 lemon::ListGraph()的副本构造函数标记为privateEdgeMap (const Graph &)需要const Graph &参数。

换句话说,ListGraphEdgeMap的概念不匹配。据我所知,他们的文档ListGraph提供了concepts::Digraph概念,其中EdgeMap需要符合ReferenceMap的实施。