#12371: The graph_decompositions/ code seems to have bounds issues
--------------------------------+-------------------------------------------
Reporter: Snark | Owner: jason, ncohen, rlm
Type: defect | Status: positive_review
Priority: major | Milestone: sage-5.0
Component: graph theory | Resolution:
Keywords: | Work issues:
Report Upstream: N/A | Reviewers:
Authors: | Merged in:
Dependencies: | Stopgaps:
--------------------------------+-------------------------------------------
Comment (by jdemeyer):
Replying to [comment:23 ncohen]:
> The popcount function as it is implemented is made for 32 bits integers
That's not clear from looking at the code.
> and I thought it was better to write a popcount function for "int" than
to write a popcount function for int32_fast_t, so here it is. This
function just tests the size of an int before returning its result.
That's my question: why do the test? Why not just do
{{{
cdef inline int popcount(int i):
return __builtin_popcount(i)
}}}
Also: there are portability issues: `__builtin_popcount()` is a GCC
extension, certainly not supported by all compilers.
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12371#comment:25>
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.