简体   繁体   English

柠檬图库的边缘权重

[英]Edge weights with the lemon graph library

I am using the Lemon graph library. 我正在使用Lemon图库。

I want to assign integer weights to the edges. 我想为边缘分配整数权重。 Thus I am using EdgeMap . 因此,我正在使用EdgeMap Unfortunality my code doesn't compile. 不幸的是,我的代码无法编译。

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

Any ideas? 有任何想法吗?

#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;
}

Looks like you're trying to call a forbidden copy constructor here. 看起来您正在尝试在此处调用禁止复制构造函数。 The copy constructor of lemon::ListGraph() is marked as private and EdgeMap (const Graph &) wants a const Graph & parameter. lemon::ListGraph()的副本构造函数被标记为private并且EdgeMap (const Graph &)一个const Graph &参数。

In other words, the concepts for ListGraph and EdgeMap don't match. 换句话说, ListGraphEdgeMap的概念不匹配。 As far as I understood from their documentation ListGraph provides the concepts::Digraph concept, where EdgeMap requires a ReferenceMap compliant implementation. 据我从他们的文档了解, ListGraph提供了concepts::Digraph EdgeMap概念,其中EdgeMap需要符合ReferenceMap实现。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM