#14704: Use GMP's mpz_t for bitsets
-------------------------------+--------------------------------------------
       Reporter:  Stefan       |         Owner:  jason        
           Type:  enhancement  |        Status:  new          
       Priority:  minor        |     Milestone:  sage-wishlist
      Component:  misc         |    Resolution:               
       Keywords:               |   Work issues:               
Report Upstream:  N/A          |     Reviewers:               
        Authors:               |     Merged in:               
   Dependencies:               |      Stopgaps:               
-------------------------------+--------------------------------------------

Comment (by leif):

 Replying to [comment:9 robertwb]:
 > The only way to know for sure is to code something up and compare
 performance, until then all discussion is rather hypothetical (and I could
 see things going both ways, but probably would place my bet on mpz_t.)

 Well, you do not only need different implementations, but also typical use
 cases to make comparisons meaningful.

 [[BR]]

 > Note that mpz_t could be a member of the bitset struct (if indeed
 another struct is needed) which would avoid one level of indirection. It
 may be worth looking at using the mpn structures directly for this low-
 level behavior as well.

 I actually did not think of not making it part of some bitset structure.
 (But the pointer to the limbs remains.)

 Note that GMP operates on limbs, so the (logical) "size" of a plain
 `mpz_t` bitset would always be a multiple of `BITS_PER_LIMB`.  (And we
 certainly don't need the "sign" of a bitset; GMP's treatment may even
 disturb.)

 It would probably make sense to (optionally) keep track of the least and
 largest element contained in a set, and perhaps its cardinality as well,
 depending on the application.

-- 
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/14704#comment:10>
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?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to