[Lemon-user] FilterNodes does not accept map adapter
Kovács Péter
kpeter at inf.elte.hu
Wed Jul 31 22:59:54 CEST 2013
Hi Wei,
Please note that FilterNodes has two template parameters. The second one
is the type of the node filter map, whose default is NodeMap<bool>
corresponding to the given graph type.
http://lemon.cs.elte.hu/pub/doc/1.2.3/a00141.html
Terefore you should write something like this:
lemon::FilterNodes<lemon::SmartGraph, lemon::NotMap<BoolMap> >
G_bg(G, notMap(alpha) );
or:
lemon::NotMap<BoolMap> not_alpha(alpha);
lemon::FilterNodes<lemon::SmartGraph, lemon::NotMap<BoolMap> >
G_bg(G, not_alpha);
Or you may try the filterNodes()
<http://lemon.cs.elte.hu/pub/doc/1.2.3/a00521.html#ga5dbf1ee0dfe1ad897d9b9f50dcc38ad0>
function.
Best regards,
Peter
On 2013.07.31. 20:30, Wei Liu wrote:
> Dear Lemon users,
>
> After reading subgraph adapters
> (http://lemon.cs.elte.hu/pub/tutorial/a00009.html#sec_subgraphs) and
> map adapters
> (http://lemon.cs.elte.hu/pub/doc/1.2.3/a00524.html#ga6d57040954dfe0188f02540fe8cf3319),
> I wrote code like this:
>
>
> lemon::SmartGraph G;
> typedef lemon::SmartGraph::NodeMap<bool> BoolMap;
> BoolMap alpha(G, false);
>
> // update alpha.
> ...
> lemon::FilterNodes<lemon::SmartGraph> G_fg(G, alpha); // works fine.
> lemon::NotMap<BoolMap> not_alpha(alpha);
> lemon::FilterNodes<lemon::SmartGraph> G_bg(G, notMap(alpha) ); //
> compile errors.
>
> The compiler gives errors as below:
> ===========================================
> /home/sci/weiliu/projects/actlearn/code/core/grabcutseg.cxx:202:66:
> error: no matching function for call to
> ‘lemon::FilterNodes<lemon::SmartGraph>::FilterNodes(lemon::SmartGraph&, lemon::NotMap<lemon::GraphExtender<lemon::SmartGraphBase>::NodeMap<bool>
> >)’
> /home/sci/weiliu/projects/actlearn/code/core/grabcutseg.cxx:202:66:
> note: candidates are:
> In file included from
> /home/sci/weiliu/projects/actlearn/code/core/common.h:16:0,
> from
> /home/sci/weiliu/projects/actlearn/code/core/grabcutseg.cxx:2:
> /home/sci/weiliu/packages/lemon-1.2.3/lemon/adaptors.h:1587:5: note:
> lemon::FilterNodes<GR, NF, typename
> lemon::enable_if<lemon::UndirectedTagIndicator<GR>
> >::type>::FilterNodes(GR&, lemon::FilterNodes<GR, NF, typename
> lemon::enable_if<lemon::UndirectedTagIndicator<GR>
> >::type>::NodeFilterMap&) [with GR = lemon::SmartGraph; NF =
> lemon::GraphExtender<lemon::SmartGraphBase>::NodeMap<bool>; typename
> lemon::enable_if<lemon::UndirectedTagIndicator<GR> >::type = void;
> lemon::FilterNodes<GR, NF, typename
> lemon::enable_if<lemon::UndirectedTagIndicator<GR>
> >::type>::NodeFilterMap =
> lemon::GraphExtender<lemon::SmartGraphBase>::NodeMap<bool>]
> /home/sci/weiliu/packages/lemon-1.2.3/lemon/adaptors.h:1587:5: note:
> no known conversion for argument 2 from
> ‘lemon::NotMap<lemon::GraphExtender<lemon::SmartGraphBase>::NodeMap<bool>
> >’ to ‘lemon::FilterNodes<lemon::SmartGraph>::NodeFilterMap& {aka
> lemon::GraphExtender<lemon::SmartGraphBase>::NodeMap<bool>&}’
> /home/sci/weiliu/packages/lemon-1.2.3/lemon/adaptors.h:1583:5: note:
> lemon::FilterNodes<GR, NF, typename
> lemon::enable_if<lemon::UndirectedTagIndicator<GR>
> >::type>::FilterNodes() [with GR = lemon::SmartGraph; NF =
> lemon::GraphExtender<lemon::SmartGraphBase>::NodeMap<bool>; typename
> lemon::enable_if<lemon::UndirectedTagIndicator<GR> >::type = void]
> /home/sci/weiliu/packages/lemon-1.2.3/lemon/adaptors.h:1583:5: note:
> candidate expects 0 arguments, 2 provided
> /home/sci/weiliu/packages/lemon-1.2.3/lemon/adaptors.h:1563:9: note:
> lemon::FilterNodes<lemon::SmartGraph>::FilterNodes(const
> lemon::FilterNodes<lemon::SmartGraph>&)
> /home/sci/weiliu/packages/lemon-1.2.3/lemon/adaptors.h:1563:9: note:
> candidate expects 1 argument, 2 provided
> =================================================
>
> Did I miss something obvious? I'm using lemon 1.2.3 and gcc 4.7
>
> I appreciate for your help.
>
> Wei
>
>
> _______________________________________________
> Lemon-user mailing list
> Lemon-user at lemon.cs.elte.hu
> http://lemon.cs.elte.hu/mailman/listinfo/lemon-user
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lemon.cs.elte.hu/pipermail/lemon-user/attachments/20130731/2e2ea4cc/attachment.html>
More information about the Lemon-user
mailing list