#15364: Introduce factor_or_zero into global namespace
-------------------------------------+-------------------------------------
       Reporter:  zabrocki           |        Owner:
           Type:  enhancement        |       Status:  needs_work
       Priority:  minor              |    Milestone:  sage-6.0
      Component:  factorization      |   Resolution:
       Keywords:                     |    Merged in:
        Authors:  Mike Zabrocki      |    Reviewers:
Report Upstream:  N/A                |  Work issues:
         Branch:                     |       Commit:
  public/ticket/15364/zabrocki/factor_or_zero|  
1e0e3da44e609c65c2b6b269f80991d01a33b844
   Dependencies:                     |     Stopgaps:
-------------------------------------+-------------------------------------
Changes (by zabrocki):

 * status:  needs_review => needs_work


Comment:

 > From the application you describe, I guess you're mostly interested in
 application to SR (the first case) in which case the most appropriate
 thing to do is probably to add a method `simplify_factor` to
 SymbolicExpression, which could happily simplify the expression "0" to the
 product "0". In the other cases, the code is just a lot clearer if people
 specify their own little one-off function that does with 0 what they want.

 I (and my colleagues that are likely to use this code) will probably be
 working with algebras over polynomial rings/fraction fields or integer
 coefficients.  SR is rather slow so I don't use it much.  This is a
 convenience function.  I can go through my list worksheets and could say
 that in about 1/3 of them I've had to work around factor throwing errors
 at me.

 > For Factorization objects: I think you really don't want those to get
 out into the wild when constructed with 0:
 > {{{
 > sage: a=Factorization([(0,1)])
 > sage: b=Factorization([(2,1)])
 > sage: a.gcd(b)
 > 1
 > sage: a^(-1)
 > 0^-1
 > }}}
 > That's just wrong. I think that's even worse than getting an attribute
 error on `.value()`.
 You are right.  We might need to clean up the factorization code so that
 it handles the 0 object properly.

--
Ticket URL: <http://trac.sagemath.org/ticket/15364#comment:13>
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/groups/opt_out.

Reply via email to