[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [igraph] iGraph and Cython
From: |
Tamás Nepusz |
Subject: |
Re: [igraph] iGraph and Cython |
Date: |
Thu, 24 Nov 2011 21:48:04 +0100 |
Dear Johannes,
I've never tried to connect igraph with Cython so far, so I don't know whether
it's of much use to you, but maybe this helps. igraph.Graph objects in Python
have a hidden method called __graph_as_cobject__ which returns the pointer to
the wrapped igraph_t structure as a Python CObject. Extracting the pointer from
the CObject should get you a void*, which then you can cast into an igraph_t*
and invoke an igraph method on it from C.
Best,
Tamas
On 24 Nov 2011, at 21:41, Johannes Reichold wrote:
> Fellow iGraphers,
>
> I am trying to speed-up my Python code using Cython. I would like to be
> able to pass a Python-created graph into a Cython function that will
> manipulate it using the underlying iGraph C-Library directly.
> If any of you have experience with this, I would highly appreciate some
> pointers, example code, or the like to get me started.
>
> Thank you very much! Best,
> Johannes
>
> _______________________________________________
> igraph-help mailing list
> address@hidden
> https://lists.nongnu.org/mailman/listinfo/igraph-help
>