#16399: Matrix stack() should coerce to a common parent
-------------------------------------+-------------------------------------
       Reporter:  tscrim             |        Owner:  tscrim
           Type:  defect             |       Status:  needs_review
       Priority:  major              |    Milestone:  sage-6.5
      Component:  linear algebra     |   Resolution:
       Keywords:  matrix stack       |    Merged in:
  coercion                           |    Reviewers:
        Authors:  Frédéric           |  Work issues:
  Chapoton, Jeroen Demeyer           |       Commit:
Report Upstream:  N/A                |  810a889f723ae78ee0331cf366e22e2308ebf74e
         Branch:                     |     Stopgaps:
  u/jdemeyer/ticket/16399            |
   Dependencies:                     |
-------------------------------------+-------------------------------------
Changes (by jdemeyer):

 * component:  coercion => linear algebra


Old description:

> I feel like we shouldn't have to do an explicit ring change to do this.
> Plus we get (somewhat) different failures for dense versus sparse
> matrices:
> {{{
> sage: m = matrix([[1,2]])
> sage: m2 = matrix(QQ, [[1/2,2]])
> sage: m.stack(m2)
> ---------------------------------------------------------------------------
> TypeError                                 Traceback (most recent call
> last)
> ...
> TypeError: matrix has denominators so can't change to ZZ.
> }}}
> {{{
> sage: m = matrix([[1,2]], sparse=True)
> sage: m.stack(m2)
> ---------------------------------------------------------------------------
> TypeError                                 Traceback (most recent call
> last)
> ...
> TypeError: no conversion of this rational to integer
> }}}

New description:

 I feel like we shouldn't have to do an explicit ring change to do this.
 Plus we get (somewhat) different failures for dense versus sparse
 matrices:
 {{{
 sage: m = matrix([[1,2]])
 sage: m2 = matrix(QQ, [[1/2,2]])
 sage: m.stack(m2)
 ---------------------------------------------------------------------------
 TypeError                                 Traceback (most recent call
 last)
 ...
 TypeError: matrix has denominators so can't change to ZZ.
 }}}
 {{{
 sage: m = matrix([[1,2]], sparse=True)
 sage: m.stack(m2)
 ---------------------------------------------------------------------------
 TypeError                                 Traceback (most recent call
 last)
 ...
 TypeError: no conversion of this rational to integer
 }}}

 Follow-up: #17595

--

--
Ticket URL: <http://trac.sagemath.org/ticket/16399#comment:18>
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.

Reply via email to