[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] Adding a C function to the igraph R package
From: |
Tamas Nepusz |
Subject: |
Re: [igraph] Adding a C function to the igraph R package |
Date: |
Tue, 15 Sep 2009 22:20:55 +0100 |
Hi Mile,
I guess you will also have to adjust the R interface appropriately and
recompile the R interface of igraph. I'm no expert in R-related issues
(it is Gabor who developed the R interface), but you can try and take
a look at the source code in interfaces/R/src/ to get a rough idea of
what you should be doing.
Note that some parts of the R interface are automatically generated,
there's an input file in interfaces/R/src/rinterface.c.in, this is
read by a Python script (tools/stimulus.py) that generates a file
called rinterface.c, and this will be compiled in the end to obtain
the R interface. The Python script takes the function definitions in
interfaces/functions.def to generate the glue code between R and the
igraph C core automatically. So, if your own function follows the
igraph calling conventions, it might happen that you simple have to
extend functions.def with the definition of your function and let
stimulus.py generate the glue code automatically. However, as I said,
I'm no expert in the inner details of the R interface, so I might be
wrong. Anyway, if you can send the source code of the C function you
added to igraph to my private email address, I can take a look at it
and give you more detailed instructions.
Regards,
--
Tamas
On 2009.09.14., at 16:14, Mile Sikic wrote:
Hello
I have made my own c function using igraph c libraries. How I can
add this function to the igraph R package. I am using 0.5.2. version
on ubuntu linux.
Regards
Mile SIkic
_______________________________________________
igraph-help mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/igraph-help