[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[igraph] Loading weights
From: |
Alvaro Graves Fuenzalida |
Subject: |
[igraph] Loading weights |
Date: |
Sat, 03 Jan 2009 11:36:48 -0500 |
User-agent: |
Thunderbird 2.0.0.19 (Macintosh/20081209) |
Hi,
I've been trying to load a graph and consider the weights. According to
the documentation, using igraph_read_graph_ncol creates an edge
attribute called "weight" for every edge. However when I try to access
it, it crashes. This is what I'm currently doing (omitting several lines
of code):
igraph_bool_t names = 1;
igraph_bool_t weight = 1;
igraph_eit_t edgeit;
igraph_read_graph_ncol(&g, stdin, NULL, names, weight, isdirected);
igraph_eit_create(&g, igraph_ess_all(IGRAPH_EDGEORDER_ID), &edgeit);
while(! IGRAPH_EIT_END(edgeit)){
printf("Peso edge %f is %f\n", IGRAPH_EIT_GET(edgeit), EAN(&g,
"name", IGRAPH_EIT_GET(edgeit)));
IGRAPH_EIT_NEXT(edgeit);
}
What am I doing wrong? Also, is there an easier way to load the weights
in a vector than using an iterator? Thanks in advance.
- [igraph] Loading weights,
Alvaro Graves Fuenzalida <=