[Top][All Lists]

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

[igraph] Question about vector

From: zhengjun chen
Subject: [igraph] Question about vector
Date: Thu, 14 Jan 2010 22:17:00 -0500


I have a problem with vector data type. After using community structure detection algorithm, I got the membership of vertices. This information is written into file.
Then I want to calculate the modularity for this community division. 
So I extract membership information from the file, and assign them to a vector. The code is in the following:  
     int member[12000] ;
     for(j=0; j<nodes; j++)  // nodes is the number of nodes in the graph
       igraph_vector_set( &membership, j, (double) member [j] );  // member array stores the membership of vertices
       printf( "%f\n", (double)VECTOR(membership)[j] );
     igraph_modularity( &graph, &membership, &modu, NULL );

The vector membership is initialized correctly. But when running  igraph_modularity() function, it reports the following errors:

*** glibc detected *** ./modularity: malloc(): memory corruption (fast): 0x08084318 ***
======= Backtrace: =========

So, I am a bit confused. Where is wrong?

Graduate research assistant
Dept of Computer Science and Engineering
Lehigh University

reply via email to

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