Nice ! sorry for not read with enough attention On Tue, Jan 13, 2015 at 4:09 PM, Gábor Csárdi <[email protected]> wrote:
> From the docs at > http://igraph.org/c/doc/igraph-Attributes.html#idm344008595600: > > Please note that the attribute handler must be attached before you call > any other igraph functions, otherwise you might end up with graphs without > attributes and an active attribute handler, which might cause unexpected > program behaviour. The rule is that you attach the attribute handler in the > beginning of your main() and never touch it again. (Detaching the attribute > handler might lead to memory leaks.) > > Also, consider passing pointers to igraph_t to functions, otherwise you > might get into trouble. The fixed code is below. G. > > #include <igraph.h> > > void f(igraph_t *g, double number){ > > igraph_real_t N = number; > SETGAN(g, "number", N); > } > > int main(void){ > > igraph_t g; > float N = 50.0; > igraph_integer_t Kin = 8.0; > igraph_bool_t directed = 1; > > igraph_i_set_attribute_table(&igraph_cattribute_table); > > igraph_erdos_renyi_game(&g, IGRAPH_ERDOS_RENYI_GNM, N, N*Kin/2.0, > directed, 0); > > f(&g, 0.2); > > return 0; > } > > > On Tue, Jan 13, 2015 at 12:09 PM, Daniel Penalva <[email protected]> wrote: > >> that's it: >> >> http://pastebin.com/fAjX2M78 >> >> On Tue, Jan 13, 2015 at 2:56 PM, Gábor Csárdi <[email protected]> >> wrote: >> >>> Please send complete code that reproduces the error. Thanks. G. >>> >>> On Tue, Jan 13, 2015 at 11:55 AM, Daniel Penalva <[email protected]> >>> wrote: >>> >>>> i setted igraph_i_set_attribute_table(&igraph_cattribute_table) in the >>>> int main(void) >>>> >>>> On Tue, Jan 13, 2015 at 2:46 PM, Daniel Penalva <[email protected]> >>>> wrote: >>>> >>>>> Hi >>>>> >>>>> Iam trying to use this interface, but got a error when encapsulated >>>>> the functions inside another, eg: >>>>> >>>>> void f(igraph_t g, double prickles){ >>>>> igraph_real_t good = prickles; >>>>> SETGAN(&g, "food", good); >>>>> } >>>>> >>>>> got a error: >>>>> >>>>> vector_ptr.c:258: igraph_vector_ptr_size: Assertion `v != ((void *)0)' >>>>> failed. >>>>> >>>>> any hint ? thank-you >>>>> >>>>> On Mon, Jan 12, 2015 at 2:25 PM, Daniel Penalva <[email protected]> >>>>> wrote: >>>>> >>>>>> thank you >>>>>> >>>>>> On Mon, Jan 12, 2015 at 7:56 AM, Tamas Nepusz <[email protected]> >>>>>> wrote: >>>>>> >>>>>>> Hi, >>>>>>> >>>>>>> > How can i add properties to the nodes of a graph ? Iam using >>>>>>> igraph with C >>>>>>> > language. >>>>>>> Please refer to http://igraph.org/c/doc/igraph-Attributes.html >>>>>>> >>>>>>> > I want to add: >>>>>>> > >>>>>>> > char * >>>>>>> > doubles >>>>>>> > int >>>>>>> > >>>>>>> > and access by the adjacency matrix structure. Is there any doc to >>>>>>> this ? >>>>>>> igraph does not use adjacency matrices to represent a graph. If you >>>>>>> want to >>>>>>> retrieve an attribute corresponding to an edge, you have to query >>>>>>> the ID of the >>>>>>> edge first using igraph_get_eid() and then retrieve the attribute of >>>>>>> interest >>>>>>> using igraph_cattribute_EAN() for numeric attributes, >>>>>>> igraph_cattribute_EAS() >>>>>>> for string attributes, or igraph_cattribute_EAB() for booleans. >>>>>>> >>>>>>> -- >>>>>>> T. >>>>>>> >>>>>>> _______________________________________________ >>>>>>> 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 >>>> >>>> >>> >>> _______________________________________________ >>> 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 >> >> > > _______________________________________________ > 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
