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.
So I extract membership information from the file, and assign them to a vector. The code is in the following:
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