#16836: __neg__ fails in CartesianProduct of CombinatorialFreeModule
-------------------------+-------------------------------------------------
Reporter: | Owner:
cnassau | Status: needs_review
Type: | Milestone: sage-6.4
defect | Resolution:
Priority: major | Merged in:
Component: | Reviewers:
categories | Work issues:
Keywords: | Commit:
Authors: | b8f88790e6fa4143906f1120a0270321b4139e2c
Christian Nassau | Stopgaps:
Report Upstream: N/A |
Branch: |
public/16836 |
Dependencies: |
-------------------------+-------------------------------------------------
Comment (by cnassau):
Hi Vincent,
> I made a small commit which forces a cast of each factor. In that case
you get a `ValueError` when you try to negate `(1, 42, 1.)` in `ZZ x NN x
RR`. Actually, wouldn't it be better that doing a negation convert it to
an element of `ZZ x ZZ x RR`. What do you think?
I think getting an error when using `-42` or `-(42,whatever)` would
definitely be misguided - these days that level of "rigor" is only
appreciated by a small and diminishing group of mostly white-bearded
Bourbakistas...
Changing the parent, OTOH, might be a good idea. I have now changed the
line again to choose the parent automatically. I'm not sure whether
there's an impact on performance, though. For that reason I have also
added a new `__neg__` for elements of the cartesian product of semigroups
with guaranteed inverses; here the parent is clear and the old code seems
appropriate.
> PS: it would be cool if you worked on the last beta release (now
`6.7.beta1`). It helps preventing merge conflicts and it avoids switching
between Sage versions. Do not change it now! But when you restart the
implementation like you did, just start it on the last beta.
Your warning came to late, I was already in the process of changing
branches, athough not entirely deliberately. The new patch is now based on
6.7.beta1 ... it seems.
--
Ticket URL: <http://trac.sagemath.org/ticket/16836#comment:11>
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.