Hi. I am having a problem with depth_first_search.
The thing I do different is that I do not put any info in a property map
and I do not want to bother myself with colormaps etc.
The application code does:
Graph g;
pass2_visitor vis;
depth_first_search(g,boost::visitor(vis));
But I get a compilation error, saying that it can not find a suitable
operator+ in the property_map...
See attached files for complete example.
Grateful for all help!
(I am running from HEAD on sourceforge cvs )
Regards Peter Aronsson
--
_________________________________________________________________
/ Peter Aronsson, Phd Student at PELAB (Programming Environments \
| Laboratory ) Department for Computer & Information Science |
| Linköping University, Sweden |
|=================================================================|
| petar@ida.liu.se , phone +46 (0)13-28 1737 Room 3B:490 |
\_________________________________________________________________/
#include "tg.hpp"
int main() {
TaskGraph g;
pass2_visitor vis;
depth_first_search(g,boost::visitor(vis));
}
#ifndef _TASKGRAPH_H
#define _TASKGRAPH_H
#include
Peter Aronsson wrote:
Hi. I am having a problem with depth_first_search. The thing I do different is that I do not put any info in a property map and I do not want to bother myself with colormaps etc.
The application code does:
Graph g; pass2_visitor vis;
depth_first_search(g,boost::visitor(vis));
But I get a compilation error, saying that it can not find a suitable operator+ in the property_map...
Well, dfs need color map for its operation. You did not provide any, so it
tried to use default color map, using std::vector and vertex indices. But,
your graph also does not provide vertex_index_t property, so you get the
error.
When I use:
typedef boost::property
Actually, I now found that the problem is when having listS as adjacency lists. The same compilation error can be produced by changing vecS to listS in the dfs-example.cpp file. Perhaps a bug? Regards Peter Aronsson -- _________________________________________________________________ / Peter Aronsson, Phd Student at PELAB (Programming Environments \ | Laboratory ) Department for Computer & Information Science | | Linköping University, Sweden | |=================================================================| | petar@ida.liu.se , phone +46 (0)13-28 1737 Room 3B:490 | \_________________________________________________________________/
Peter Aronsson wrote:
Actually, I now found that the problem is when having listS as adjacency lists.
Yes, when you have vecS for vertex storage, the vertex_index_t property is automatically defined.
The same compilation error can be produced by changing vecS to listS in the dfs-example.cpp file.
Perhaps a bug?
It's more like design issue. Would be nice to have automatic vertex_index_t for listS but nobody yet implemented this, and even has not decided how this can be done. - Volodya
Vladimir Prus wrote:
Peter Aronsson wrote:
Actually, I now found that the problem is when having listS as adjacency lists.
Yes, when you have vecS for vertex storage, the vertex_index_t property is automatically defined.
The same compilation error can be produced by changing vecS to listS in the dfs-example.cpp file.
Perhaps a bug?
It's more like design issue. Would be nice to have automatic vertex_index_t for listS but nobody yet implemented this, and even has not decided how this can be done.
Yes your right. I guess I have to live with your proposed solution for now. Thank you for the help. Regards Peter Aronsson -- _________________________________________________________________ / Peter Aronsson, Phd Student at PELAB (Programming Environments \ | Laboratory ) Department for Computer & Information Science | | Linköping University, Sweden | |=================================================================| | petar@ida.liu.se , phone +46 (0)13-28 1737 Room 3B:490 | \_________________________________________________________________/
participants (2)
-
Peter Aronsson
-
Vladimir Prus