On Mon, Feb 28, 2011 at 11:12 AM, Stephen Hartke <har...@gmail.com> wrote:
> Assignment of a matrix to a matrix slice works as expected except for when
> the slice is 1x1; in that case, Sage expects a scalar instead of a 1x1
> matrix.

I think this has changed very recently.  Your code seems to work in
4.6.2.rc0, but not in 4.6.1.  You can actually crash Sage 4.6.1 pretty
hard doing this -- most fields simply return an error, but SR doesn't,
and that leads to trouble, at least for me:

sage: A = matrix(SR, 2, 2, range(4))
sage: A[0:1, 0:1] = A[0:1, 0:1] # takes several seconds but finally agrees
sage: A
[[0]   1]
[  2   3]
sage: A[0,0], type(A[0,0]), parent(A[0,0])
([0], <type 'sage.symbolic.expression.Expression'>, Symbolic Ring)
sage: A[0,0] in SR
terminate called after throwing an instance of 'std::runtime_error'
  what():  Number_T::hash() python function (__hash__) raised exception
/Applications/sage/local/bin/sage-sage: line 300: 41613 Abort trap
         sage-ipython "$@" -i


Doug

--
Department of Earth Sciences
University of Hong Kong

-- 
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel+unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URL: http://www.sagemath.org

Reply via email to