Thank you for the reply! Do you know, is there's any noticeable overhead of frequent python::extract() calls? Is it urgent to have some pre-extracted data-structure on c++ side, or this is similar to having a pointer?
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
вторник, 13 июля 2021 г., 23:44, Tiago de Paula Peixoto tiago@skewed.de написал(а):
Am 13.07.21 um 21:58 schrieb sebyakin.a:
Hello,
My question is: which parts of a code I should modify to add internal
property maps of custom type? Is it possible without ground-breaking
modifications, or should I look a way for some workaround?
My usecase is to bridge python integer objects and big integer objects
(from intx library) on c++ side, as a vertex property. I'm going to
perform relatively heavy math operations and graph operations, so I want
to write a C++ extension that does it.
So I thought, is it possible to add custom property map handlers for big
integers, that will convert python long objects to intx type and store
it in that type later.
The simplest thing for you to do is to use Boost.Python to reflect your
custom types to python, which then you can store in a property map of
type "python::object". You can access the property map values from your
C++ extension by using python::extract().
Tiago de Paula Peixoto tiago@skewed.de
graph-tool mailing list -- graph-tool@skewed.de
To unsubscribe send an email to graph-tool-leave@skewed.de