#19249: Interface with TdLib
-------------------------------------+-------------------------------------
       Reporter:  llarisch           |        Owner:
           Type:  enhancement        |       Status:  needs_info
       Priority:  minor              |    Milestone:  sage-6.10
      Component:  packages:          |   Resolution:
  experimental                       |    Merged in:
       Keywords:                     |    Reviewers:  Nathann Cohen
        Authors:                     |  Work issues:
Report Upstream:  N/A                |       Commit:
         Branch:                     |  f27dfd1e754b1fb7c660c4a933a1770fa571b709
  u/llarisch/interface_with_tdlib    |     Stopgaps:
   Dependencies:                     |
-------------------------------------+-------------------------------------

Comment (by llarisch):

 Hello,

 Replying to [comment:36 ncohen]:
 > 3) If, because of some limitation of Cython, we cannot directly convert
 Python into X (or turn Y into Python) then we can have another layer in
 the middle, i.e. a c++ file, which is what happens with boost_interface.

 In my opinion, this is the case and for that reason sage_tdlib.cpp exists.
 In addition, i cannot use boost_interface, since vertex properties are not
 covered there. As mentioned above, i need a

 ctypedef BoostGraph[vecS, vecS, undirectedS, vecS, X] BG,

 where X is some struct. Concrete (see sage_tdlib.cpp):

 For the input graph

 {{{

 struct Vertex{
     ...
     ...
     unsigned int id;
     ...
 };

 typedef boost::adjacency_list<boost::setS, boost::vecS,
 boost::undirectedS, Vertex> TD_graph_t;
 }}}


 And for the output treedecomposition:


 {{{
 struct bag{
     ...
     ...
     std::set<unsigned int> bag;
     ...
 };

 typedef boost::adjacency_list<boost::vecS, boost::vecS,
 boost::undirectedS, bag> TD_tree_dec_t;
 }}}

 The reason for sage_tdlib.cpp is to do the conversion

 sage graph -> V,E as vectors -> boost graph

 and

 boost graph (tree decomposition) -> V, E, bags as vectors -> sage graph.

 > This way we adapt to whatever the library expect, and there is no need
 to have anything sage-related in the library.

 Currently, nothing sage-related (except for the build-system) is in the
 library.

 Lukas

--
Ticket URL: <http://trac.sagemath.org/ticket/19249#comment:40>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica, 
and MATLAB

-- 
You received this message because you are subscribed to the Google Groups 
"sage-trac" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-trac.
For more options, visit https://groups.google.com/d/optout.

Reply via email to