#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: | e968b23aa07a1d22cd9c8e05448f2eb186328df7
u/llarisch/interface_with_tdlib | Stopgaps:
Dependencies: |
-------------------------------------+-------------------------------------
Comment (by llarisch):
Thanks for the hints!
> - I do not understand why you need to copy/paste sage_tdlib.cpp into
your
> tarball if you want it to compile. Could you please explain me? In no
other
> package do we need to do such a thing. Usually the tarball works by
itself,
> and we have in Sage some interface code that is linked with it.
>
> - One such instance is the interface with boost. You will find it in the
> following files:
>
> sage/graphs/base/boost_graph.pyx
> sage/graphs/base/boost_graph.pxd
> sage/graphs/base/boost_interface.cpp
>
Since there is no cython-way to generate a boost graph with an appended
struct for the vertices (boost_graph.pyx only supports appended structs
for edges), a boost graph has to be generated manually (make_tdlib_graph
in *.pyx, sage_tdlib_*).
If there would exist a cython-interface for the required graphs, one could
build the *.so by instantiating the exact algorithm, which would require
to copy a *.cpp file (that only containes a line that instantiates the
exact algorithm) and a makefile into the tarball.
Do you have a idea for this?
> - Your 'spkg-install' file copies files that you removed from your
tarball
> (i.e. ./.libs/*)
./libs is generated by make (automake creates a .libs by default) ->
./libs should exist
> - I do not understand what exactly this warning means. Could you tell
me? `^^;`
> {{{
> +#!!!!!! NOTICE !!!!!!!!
> +#Sage vertices have to be named by unsigned integers
> +#Sage bags of decompositions have to be lists of unsigned integers
> +#!!!!!!!!!!!!!!!!!!!!!!!!!!
> }}}
G.vertices() should return a list of unsigned integers, e.g.
treedecomposition_exact() does not work with TutteGraph(), since
TutteGraph().vertices() returnes a list of tuples
> - It is slightly incorrect to have your class `TreeDecomposition`
inherit from
> `Graph`, while having a function like `get_width` rely on the
vertices' labels
> (you assume that they are sets). Indeed, the vertices of a graph can
be
> relabeled, which would break this function. I don't think that you
need this
> class, to be honest.
Ok, i just thought something like that would be nice:
sage: T = tdlib.treedecomposition_exact(G)
tree decomposition of width 4 computed
sage: T
Treedecomposition of width 4 on 15 vertices <--
Would it be better to use g.name("tree decompostion") for this purposes?
Lukas
--
Ticket URL: <http://trac.sagemath.org/ticket/19249#comment:35>
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.