Jeremy Siek wrote:
I'm sorry, but could I ask you to post a complete C++ program so that
I can
immediately reproduce the problem.
Thanks,
Jeremy
Sure,
Here is a shortened version that should produce the error on tg.cpp:62
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"
VertexNameMap::type VertexNameProperty(TaskGraph* tg)
{
boost::vertex_name_t pname;
VertexNameMap::type pmap = get(pname, *tg);
return pmap;
};
VertexUniqueIDMap::type VertexUniqueIDProperty(TaskGraph* tg)
{
vertex_unique_id_t pname;
VertexUniqueIDMap::type pmap = get(pname, *tg);
return pmap;
};
VertexExecCostMap::type VertexExecCostProperty(TaskGraph* tg)
{
vertex_execcost_t pname;
VertexExecCostMap::type pmap = get(pname, *tg);
return pmap;
}
EdgeCommCostMap::type EdgeCommCostProperty(TaskGraph* tg)
{
boost::edge_weight_t pname;
EdgeCommCostMap::type pmap= get(pname, *tg);
return pmap;
};
int getCommCost(EdgeID edge,TaskGraph * tg)
{
return get(EdgeCommCostProperty(tg),edge);
}
void setCommCost(EdgeID edge, int weight,TaskGraph * tg)
{
put(EdgeCommCostProperty(tg),edge, weight);
}
int getTaskID(VertexID v,TaskGraph * tg)
{
return get(VertexUniqueIDProperty(tg),v);
}
std::pair
children(VertexID v, TaskGraph &tg)
{
OutEdgeIterator e,e_end;
tie(e,e_end) = out_edges(v,tg);
ChildrenIterator c(e,&tg),c_end(e_end,&tg);
return make_pair(c,c_end);
}
std::pair
parents(VertexID v, TaskGraph &tg)
{
InEdgeIterator e,e_end;
tie(e,e_end) = in_edges(v,tg);
ParentsIterator c(e),c_end(e_end);
return make_pair(e,e_end);
}
#ifndef _TASKGRAPH_H
#define _TASKGRAPH_H
#include
#include <iostream> // for std::cout
#include <utility> // for std::pair
#include <algorithm> // for std::for_each
#include // for boost::tie
#include // for boost::graph_traits
#include
#include
#include
//Task graph types
using namespace std;
using boost::tie;
struct vertex_execcost_t {
typedef boost::vertex_property_tag kind;
};
struct vertex_unique_id_t {
typedef boost::vertex_property_tag kind;
};
struct edge_result_set_t {
typedef boost::edge_property_tag kind;
};
typedef boost::property
>
> VertexProperty;
typedef boost::property EdgeProperty;
typedef boost::adjacency_list TaskGraph;
typedef boost::property_map VertexNameMap;
typedef boost::property_map VertexExecCostMap;
typedef boost::property_map VertexUniqueIDMap;
typedef boost::property_map EdgeCommCostMap;
typedef boost::graph_traits<TaskGraph>::vertex_descriptor VertexID;
typedef boost::graph_traits<TaskGraph>::vertex_iterator VertexIterator;
typedef boost::graph_traits<TaskGraph>::edge_descriptor EdgeID;
typedef boost::graph_traits<TaskGraph>::edge_iterator EdgeIterator;
typedef boost::graph_traits<TaskGraph>::out_edge_iterator OutEdgeIterator;
typedef boost::graph_traits<TaskGraph>::in_edge_iterator InEdgeIterator;
typedef boost::adjacency_iterator_generator::type ChildrenIterator;
typedef boost::inv_adjacency_iterator_generator::type ParentsIterator;
VertexNameMap::type VertexNameProperty(TaskGraph* tg);
VertexUniqueIDMap::type VertexUniqueIDProperty(TaskGraph* tg);
VertexExecCostMap::type VertexExecCostProperty(TaskGraph* tg);
EdgeCommCostMap::type EdgeCommCostProperty(TaskGraph* tg);
int getCommCost(EdgeID edge,TaskGraph * tg);
void setCommCost(EdgeID edge, int weight,TaskGraph * tg);
double getExecCost(VertexID v,TaskGraph * tg);
double getExecCost(int uniqueID,TaskGraph * tg);
void setExecCost(VertexID v, double weight,TaskGraph * tg);
int getTaskID(VertexID v,TaskGraph * tg);
std::pair
children(VertexID v, TaskGraph &tg);
std::pair
parents(VertexID v, TaskGraph &tg);
#endif