igraph-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [igraph] number of nodes


From: Gábor Csárdi
Subject: Re: [igraph] number of nodes
Date: Wed, 25 Nov 2009 22:06:02 +0100

The memory for the igraph_t data structure is never allocated here.
You need to declare the graph as

igraph_t graph;

and then supply &graph to igraph functions. Or, if you want the
igraph_t to be allocated on the heap, then allocate memory for it with
malloc.

G.

On Wed, Nov 25, 2009 at 9:17 PM, Roberto Pagliari <address@hidden> wrote:
> the code I used is this
>
> int main(void) {
> igraph_t *graph;
> FILE *myfile;
> igraph_vector_t *membership;
> igraph_vector_t *weights;
> igraph_vector_t *initial;
> igraph_vector_bool_t *fixed;
> int num_nodes;
> myfile = fopen("europe.gml", "r");
> igraph_read_graph_gml(graph, myfile);
> num_nodes = igraph_vcount(graph);
> // printf("number of nodes: %f\n", igraph_vcount(graph));
> // igraph_community_label_propagation(graph, )
> fclose(myfile);
> return 0;
> }
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
>
>



-- 
Gabor Csardi <address@hidden>     UNIL DGM




reply via email to

[Prev in Thread] Current Thread [Next in Thread]