res is a vector of pointers. Each pointer points to an igraph_vector_t. So you need to go over the pointers and print the vector one by one, by calling igraph_vector_print().
Gabor On Sun, Mar 23, 2014 at 4:15 PM, Sana Rahim <[email protected]> wrote: > Hello, I am trying to write the results calculated from shortest path to a > file, but not able to do. When i try to print by following way it produces > some addresses and not paths. Please guide > > void main() > { > igraph_t graph; > igraph_vector_t v; > igraph_vector_ptr_t res; > igraph_vector_t nrgeo; > igraph_integer_t sender; > > FILE *input; > FILE *fp; > long int i; > input=fopen("DCell2k.txt", "r"); > > igraph_read_graph_edgelist(&graph, input, 0, 0); > > /*initializing res and nrgeo*/ > igraph_vector_ptr_init(&res, 0); > igraph_vector_init(&nrgeo, 0); > fp=fopen("results.txt", "w"); > for(sender=0; sender<20; sender++) > { > if(sender%3==0) > { > continue; > } > igraph_get_all_shortest_paths(&graph, &res, &nrgeo, sender, > igraph_vss_seq(1,20), IGRAPH_ALL); > fprintf(fp, "%p\n", VECTOR(res)); > } > igraph_destroy(&graph); > > } > > > _______________________________________________ > igraph-help mailing list > [email protected] > https://lists.nongnu.org/mailman/listinfo/igraph-help > >
_______________________________________________ igraph-help mailing list [email protected] https://lists.nongnu.org/mailman/listinfo/igraph-help
