Hi all!
I'm new at using boost and my request certainly is obvious but I can't manage
to get the error...
I am trying to set std::vector's type vertex properties in a graph. But it
does not want te set a property to more than one edge.
The program is the following:
/****************************************code*****************************/
#include <vector>
#include <iostream>
#include <list>
#include <map>
//boost includes
#include
#include
#include
#include
#include
using namespace std;
enum edge_intersec_t { edge_intersec };
enum edge_dist_t { edge_dist };
enum vertex_param_t { vertex_param};
namespace boost {
BOOST_INSTALL_PROPERTY(edge, intersec);
BOOST_INSTALL_PROPERTY(edge, dist);
BOOST_INSTALL_PROPERTY(vertex, param);
}
using namespace boost;
typedef property >
EdgeProp;
typedef property VertexProp;
typedef adjacency_list Graph;
typedef graph_traits<Graph>::edge_descriptor edge_descriptor;
int main(int argc, char** argv)
{
int NbRegions = 9;
Graph g(NbRegions);
edge_descriptor e;
bool inserted;
tie(e,inserted) = add_edge(vertex(0,g),vertex(1,g),EdgeProp(0,20),g);
tie(e,inserted) = add_edge(vertex(0,g),vertex(2,g),0,g);
tie(e,inserted) = add_edge(vertex(1,g),vertex(2,g),0,g);
tie(e,inserted) = add_edge(vertex(3,g),vertex(4,g),0,g);
tie(e,inserted) = add_edge(vertex(3,g),vertex(5,g),0,g);
tie(e,inserted) = add_edge(vertex(3,g),vertex(7,g),0,g);
tie(e,inserted) = add_edge(vertex(4,g),vertex(5,g),0,g);
tie(e,inserted) = add_edge(vertex(5,g),vertex(6,g),0,g);
tie(e,inserted) = add_edge(vertex(1,g),vertex(4,g),50,g);
tie(e,inserted) = add_edge(vertex(1,g),vertex(3,g),100,g);
tie(e,inserted) = add_edge(vertex(0,g),vertex(4,g),200,g);
tie(e,inserted) = add_edge(vertex(2,g),vertex(5,g),500,g);
tie(e,inserted) = add_edge(vertex(2,g),vertex(6,g),20,g);
tie(e,inserted) = add_edge(vertex(2,g),vertex(4,g),50,g);
tie(e,inserted) = add_edge(vertex(0,g),vertex(3,g),50,g);
std::vector<float> param(2);
std::vector<float> propriete(2);
param[0] = 800;
std::cerr<<"param[0] = "<