#7651: c_graph backends should include a "reversed" copy for digraphs in the
sparse case
----------------------------+-----------------------------------------------
   Reporter:  rlm           |       Owner:  rlm         
       Type:  enhancement   |      Status:  needs_review
   Priority:  major         |   Milestone:  sage-4.3.1  
  Component:  graph theory  |    Keywords:              
Work_issues:                |      Author:              
   Upstream:  N/A           |    Reviewer:              
     Merged:                |  
----------------------------+-----------------------------------------------

Comment(by ncohen):

 I saw you replaced
 {{{
 for w in (self._cg.out_neighbors(v) if side == 1 else
 self._cg.in_neighbors(v)):
 }}}
 with
 {{{
 if side == 1:
    neighbors = self._cg.out_neighbors(v)
 elif self._cg_rev is not None: # Sparse
    neighbors = self._cg_rev.out_neighbors(v)
 else: # Dense
    neighbors = self._cg.in_neighbors(v)
 }}}
 I understand what you mean, but wouldn't it easier for developpers to
 define a function "in_neighbors" or "out_neighbors" doing this stuff to
 avoid dealing with the implementation of graphs when in the c_graph.pyx
 file ( where the algorithm are more graph-theoretic and a bit further from
 the implementation ) ?

 This kind of thing is bound to reappear very often as we write algorithms
 in Cython... :-)

 Nathann

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/7651#comment:7>
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 post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/sage-trac?hl=en.


Reply via email to