igraph-help
[Top][All Lists]
Advanced

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

Re: [igraph] Problem with C attribute handler


From: Juanjo Jimenez
Subject: Re: [igraph] Problem with C attribute handler
Date: Mon, 7 Sep 2009 12:10:09 -0400

Gábor,

Thanks for the quick answer.

Until last week, we were using the stable version, but we just got the 0.6-main branch from launchpad with bzr. Last revision is 1652, commited by Tamas Nepusz (fixed Makefile.am files so make dist works properly again). We were getting the same error with the stable version.

Here I'm attaching 2 text files. The first one, is an importer for a graph format that we created. We call it xwel format. We put this function in foreign.c. The second file contains a graph in the xwel format. The format is very simple:

*Vertices <number_of_vertices>
id0 label0 value0
...
idN labelN valueN
*Arcs
from0 to0 weight0
...
fromM toM weightM

where "fromI toJ" is an arc from idI to idJ


Thanks again.

2009/9/7 Gábor Csárdi <address@hidden>
Juano,

there is too little information here to tell what is wrong. I don't
even know which igraph version this is. But since the C attribute
handler works for our (not too extensive) tests, I would say that most
likely there is an error in your code. But of course it is also
possible that this is an igraph bug.

If you could send the code for handling the attributes from C, then
maybe we would be able to help you.

Best,
Gabor

On Mon, Sep 7, 2009 at 2:36 AM, Juanjo Jimenez<address@hidden> wrote:
> We're working on a SNA project and we've been using igraph library with R.
> Basically, all the programming is done in C.
>
> We added an importer for a graph format defined by us. It's for directed
> graphs with vertex and arc attributes. Apparently, up to this point we had
> no trouble and all works fine. We can access to the vertex and arc
> attributes from the prompt in the R interpreter.
>
> Right now, we're dealing with a C function that needs to query the
> attributes of the vertices and arcs and we are having some problems.
> After building and installing, we import a graph with our importer and then
> when our function is called we get this message from the interpreter:
>
> At cattributes.c:753 : Unknown attribute, Invalid value
>
> In our C function we're using igraph_cattribute_VANV to get all the values
> of all the values of a vertex attribute. Here's where the error comes up.
> Debbuging our code, we ended in this function defined in cattributes.c:
>
> igraph_bool_t igraph_i_cattribute_find(const igraph_vector_ptr_t *ptrvec,
> const char *name, long int *idx) {
> long int i, n=igraph_vector_ptr_size(ptrvec);
> igraph_bool_t l=0;
>
> …
>
> }
>
> The variable n is a negative number after calling igraph_vector_ptr_size
> when should be 2.
>
> From the igraph documentation, we know this:
>
> “… There is an experimental attribute handler that can be used from C code.
> ...”
>
> and were wondering if our problem is related to this experimental state or
> is something else.
>
> Thanks and sorry about my English.
>
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> http://lists.nongnu.org/mailman/listinfo/igraph-help
>
>



--
Gabor Csardi <address@hidden>     UNIL DGM


_______________________________________________
igraph-help mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/igraph-help

Attachment: xwel.importer
Description: Binary data

Attachment: red.xwel
Description: Binary data


reply via email to

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