You need to initialize nrgeo as well. Could you please read the
documentation of igraph_get_all_shortest_paths() at
http://igraph.org/c/doc/igraph-Structural.html#igraph_get_all_shortest_paths?

G.


On Wed, Feb 26, 2014 at 9:25 AM, Sana Rahim <[email protected]> wrote:

> Even after initializing the res as you mentioned, it is still giving the
> same segmentation fault. Please guide.
>
> Regards
>
>
>
>   On Wednesday, 26 February 2014 6:14 PM, Tamás Nepusz <[email protected]>
> wrote:
>  The "res" vector that you pass in to igraph_get_all_shortest_paths must
> be initialized as well using igraph_vector_ptr_init(&res, 0);
>
> --
> T.
>
>
> On Wednesday, 26 February 2014 at 11:32, Sana Rahim wrote:
>
> > Thank you for reply. But when i initialize it i get segmentation fault.
> >
> > #include<igraph.h>
> > void main()
> > {
> > igraph_t graph;
> > igraph_vector_t v;
> > igraph_vector_ptr_t res;
> > igraph_vector_t nrgeo;
> >
> > igraph_real_t edges[] = {1, 2, 1, 4, 2, 3, 3, 7, 4, 5, 5, 6, 6, 9, 7, 8,
> 8, 9};
> >
> > igraph_vector_view(&v, edges, sizeof(edges)/sizeof(double));
> >
> > igraph_create(&graph,&v, 0, IGRAPH_UNDIRECTED);
> >
> >
> > igraph_get_all_shortest_paths(&graph, &res, &nrgeo, 1,
> igraph_vss_seq(2,8), IGRAPH_ALL);
> >
> > igraph_destroy(&graph);
> >
> > }
> >
> > Regards,
> >
> >
> > On Tuesday, 25 February 2014 6:52 PM, Gábor Csárdi <
> [email protected] (mailto:[email protected])> wrote:
> > See http://igraph.org/c/doc/igraph-Iterators.html
> >
> > Gabor
> >
> >
> > On Mon, Feb 24, 2014 at 11:45 PM, Sana Rahim <[email protected](mailto:
> [email protected])> wrote:
> > > Hi, thanks for immediate reply. How should I initialize vs? When i
> initialize it like igraph_vs_t vs=3 or give value to vs , it says invalid
> initializer.
> > >
> > > Regards
> > >
> > >
> > > On Tuesday, 25 February 2014 1:28 AM, Gábor Csárdi <
> [email protected] (mailto:[email protected])> wrote:
> > > You never initialize vs.
> > >
> > > G.
> > >
> > >
> > > On Mon, Feb 24, 2014 at 2:35 PM, Sana Rahim <[email protected](mailto:
> [email protected])> wrote:
> > > > Hi, when I run the following code i get this error Error at
> iterators.c:769 :Cannot create iterator, invalid selector, Invalid value
> > > > Aborted.
> > > > igraph_t graph;
> > > > igraph_vector_t v;
> > > > igraph_vector_ptr_t vertices;
> > > > igraph_vector_ptr_t edges1;
> > > > igraph_vs_t vs;
> > > > igraph_matrix_t res;
> > > > igraph_vector_ptr_t res1;
> > > > igraph_vector_t nrgeo;
> > > > igraph_real_t edges[] = {1, 2, 1, 4, 2, 3, 3, 7, 4, 5, 5, 6, 6, 9,
> 7, 8, 8, 9};
> > > > igraph_vector_view(&v, edges, sizeof(edges)/sizeof(double));
> > > > igraph_create(&graph,&v, 0, IGRAPH_UNDIRECTED);
> > > > igraph_get_all_shortest_paths(&graph, &res1, &nrgeo, 1, vs,
> IGRAPH_ALL);
> > > > igraph_destroy(&graph);
> > > >
> > > > Where am I making a mistake, please help.
> > > >
> > > > Regards
> > > >
> > > > _______________________________________________
> > > > igraph-help mailing list
> > > > [email protected] (mailto:[email protected])
> > > > https://lists.nongnu.org/mailman/listinfo/igraph-help
> > >
> > >
> > >
> > >
> > >
> > > _______________________________________________
> > > igraph-help mailing list
> > > [email protected] (mailto:[email protected])
> > > https://lists.nongnu.org/mailman/listinfo/igraph-help
> >
> >
> >
> >
> > _______________________________________________
> > igraph-help mailing list
> > [email protected] (mailto:[email protected])
>
> > https://lists.nongnu.org/mailman/listinfo/igraph-help
>
>
>
>
>
> _______________________________________________
> 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

Reply via email to