#14967: Bug with DiGraph
--------------------------------+--------------------------
       Reporter:  mercatp       |         Owner:
           Type:  defect        |        Status:  new
       Priority:  major         |     Milestone:  sage-5.11
      Component:  graph theory  |    Resolution:
       Keywords:  graph         |     Merged in:
        Authors:  Paul Mercat   |     Reviewers:
Report Upstream:  N/A           |   Work issues:
         Branch:                |  Dependencies:
       Stopgaps:                |
--------------------------------+--------------------------
Changes (by rlm):

 * cc: ncohen (added)


Comment:

 The reason we did this was to make the most common cases as fast as
 possible. Since a lot of the graphs in Sage are on the integers [0, 1,
 ..., n] it is much faster if the underlying representation doesn't have to
 spend extra time translating between the user-exposed vertices and those
 of the underlying implementation. The reasoning is to take the cheapest
 route to integer possible. If the vertex is not an integer, we need to
 update translation dictionaries and this is more expensive.

 When this code was written Cython would not allow you to assign 1/2 to a C
 integer. We used the fact that try blocks are very cheap to take advantage
 of this behavior for speed.

 I am worried that  {{{if u in IntegerRing}}} will take a long time due to
 coercion. Have you done any profiling to see the difference?

--
Ticket URL: <http://trac.sagemath.org/ticket/14967#comment:1>
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/groups/opt_out.


Reply via email to