#16453: Cythonize quiver paths
-------------------------------------+-------------------------------------
Reporter: SimonKing | Owner:
Type: enhancement | Status: needs_review
Priority: major | Milestone: sage-6.4
Component: algebra | Resolution:
Keywords: | Merged in:
Authors: Simon King | Reviewers:
Report Upstream: N/A | Work issues:
Branch: | Commit:
public/ticket/16453 | e03b66156f5b5212bfeffc937887ae5c29a1a6ca
Dependencies: #15820 | Stopgaps:
-------------------------------------+-------------------------------------
Comment (by SimonKing):
Replying to [comment:76 jdemeyer]:
> In these 3 cases, why don't you use the corresponding `biseq` functions?
> {{{
> return mpn_cmp(cself._path.data.bits, other._path.data.bits,
cself._path.data.limbs)
> }}}
There is no dedicated comparison function for `biseq_t`. The comparison of
`BoundedIntegerSequence` would first check the type of the given arguments
(needed, since coercion is not involved), then compare the bounds of the
two integer sequences, and finally call `bitset_cmp` (which mainly does
`mpn_cmp`). But here, we already know (by coercion) that the two paths
belong to the same semigroup, thus, have the same type and bound.
> {{{
> cdef mp_limb_t* p = self._path.data.bits
> for i from self._path.data.limbs>i>=0:
> h0 = h
> h += deref(postinc(p))
> if h<h0: # overflow
> preinc(h)
> }}}
That's for hash. Again, there is no dedicated hash function for `biseq_t`.
> {{{
> out._path.itembitsize = itembitsize
> out._path.mask_item = limb_lower_bits_up(itembitsize)
> out._path.length = length
> if length>0:
> sig_on()
> bitset_init(out._path.data, 1)
> bitset_unpickle(out._path.data, bitset_data)
> sig_off()
> }}}
> (and the corresponding `bitset_pickle()` of course)
Pickling is defined for `BoundedIntegerSequence`, not for `biseq_t`.
Or are you saying I ''should'' implement those functions on the level of
`biseq_t`?
--
Ticket URL: <http://trac.sagemath.org/ticket/16453#comment:81>
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.