Re: [graph-tool] Accessibility from C++

2019-10-22 Thread Gerion Entrup
Am Donnerstag, 10. Januar 2019, 23:51:29 CEST schrieb Tiago de Paula Peixoto:
> Am 10.01.19 um 13:48 schrieb Gerion Entrup:
> > So my question is: Is it possible to get the C++ graph object out of the
> > Python graph object? Is it possible to fill the C++ graph object
> > directly with nodes and edges?
> 
> This is possible, and not very difficult. However, it's undocumented at the
> moment.
> 
> I'm working on some documentation, and I'll release it soon.
> 
> > Another point is that I need to attach a pointer (or shared_ptr) to a
> > custom C++ type to some nodes. The pointer does not need to be
> > accessible or visible from Python. Is this possible in a simple way?
> > (Of course I can workaround with an e.g. map of type (vertex id,
> > pointer).)
> 
> You can either use a property map of type int64_t, which is enough to hold
> pointers. You can also use type python::object, which will hold whatever you
> can express in python, inclusive custom classes.
> 
> 

I have seen that you wrote some documentation [1]. Thank you!

Gerion

[1] 
https://graph-tool.skewed.de/static/doc/demos/cppextensions/cppextensions.html


signature.asc
Description: This is a digitally signed message part.
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] Accessibility from C++

2019-01-26 Thread esurface
I'm looking forward to this as well. Information on compiling c++ libraries
modularly would be appreciated as well. For example, I only need the core
functionality and not the inference modules.

Thank you!



--
Sent from: 
http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] Accessibility from C++

2019-01-21 Thread Tiago de Paula Peixoto
Am 17.01.19 um 19:51 schrieb davidt:
> Hello
> 
> I have exactly the same requirement, but perhaps more specifically: how do I
> get hold of the underlying boost::adjacency_list object to pass to C++ and
> then extract from a boost::python::object?

As I said before, I will provide documentation on this soon. Please have
some patience.

Best,
Tiago

-- 
Tiago de Paula Peixoto 



signature.asc
Description: OpenPGP digital signature
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


Re: [graph-tool] Accessibility from C++

2019-01-21 Thread davidt
Hello

I have exactly the same requirement, but perhaps more specifically: how do I
get hold of the underlying boost::adjacency_list object to pass to C++ and
then extract from a boost::python::object?

To do this I just need to know two things: “stuff” and “command” in 

typedef boost::adjacency_list< stuff > Graph;

and

boost::python::eval(“command”,main_namespace)

respectively. I could then extract the adjacency_list object of a graph
created with graph-tool using boost::python::extract as follows:

boost::python::object python_graph =
boost::python::eval(“command”,main_namespace);

Graph &cpp_graph = boost::python::extract (python_graph);

I have attached some complete sample code that does this for a class Dog
that is wrapped as a python module manually. If you could provide me with
what I could use for the equivalent graph-tool “command” and “stuff”
(obviously the later will vary depending on the graph type, but let’s say
just for the default type initially) that would be great thanks!

David

  Dog.h

  
main.cpp

  
module.cpp

  



--
Sent from: 
http://main-discussion-list-for-the-graph-tool-project.982480.n3.nabble.com/
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


[graph-tool] Accessibility from C++

2019-01-10 Thread Tiago de Paula Peixoto
Am 10.01.19 um 13:48 schrieb Gerion Entrup:
> So my question is: Is it possible to get the C++ graph object out of the
> Python graph object? Is it possible to fill the C++ graph object
> directly with nodes and edges?

This is possible, and not very difficult. However, it's undocumented at the
moment.

I'm working on some documentation, and I'll release it soon.

> Another point is that I need to attach a pointer (or shared_ptr) to a
> custom C++ type to some nodes. The pointer does not need to be
> accessible or visible from Python. Is this possible in a simple way?
> (Of course I can workaround with an e.g. map of type (vertex id,
> pointer).)

You can either use a property map of type int64_t, which is enough to hold
pointers. You can also use type python::object, which will hold whatever you
can express in python, inclusive custom classes.

-- 
Tiago de Paula Peixoto 





signature.asc
Description: OpenPGP digital signature
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool


[graph-tool] Accessibility from C++

2019-01-10 Thread Gerion Entrup
Hi,

I need a graph library that is accessible for both Python and C++
together with a few other requirements.

graph-tool seems to fulfill all this requirements. However, I don't find
any information whether the library is usable from C++ code as well.

My project consists out of several modules that are all aware a one main
graph object. Each module can be written either in Python or C++. The
modules itself are managed with some Python code.

So my question is: Is it possible to get the C++ graph object out of the
Python graph object? Is it possible to fill the C++ graph object
directly with nodes and edges?

Another point is that I need to attach a pointer (or shared_ptr) to a
custom C++ type to some nodes. The pointer does not need to be
accessible or visible from Python. Is this possible in a simple way?
(Of course I can workaround with an e.g. map of type (vertex id,
pointer).)

Regards,
Gerion


signature.asc
Description: This is a digitally signed message part.
___
graph-tool mailing list
graph-tool@skewed.de
https://lists.skewed.de/mailman/listinfo/graph-tool