On Mar 23, 2008, at 12:11 PM, didier deshommes wrote: > On Sat, Mar 22, 2008 at 11:49 PM, Jason Grout > <[EMAIL PROTECTED]> wrote: >> >> Jason Grout wrote: >>> I'm in the process of overhauling the matrix() constructor. I ran >>> across an (undocumented) behavior of the current matrix() function. >>> >>> >> To clarify: >> >> 1. What should matrix(2,3,[[1,2],[3,4],[5,6]]) give? >> a) a 2-row 3-column matrix [[1,2,3], [4,5,6]] >> b) raise an error since the nested info doesn't agree with the given >> number of rows and columns >> >> 2. What should matrix(2,3,[[1],[2,3],[4,5,6]]) give? >> a) a 2-row 3-column matrix [[1,2,3],[4,5,6]] >> b) raise an error since the nested info doesn't agree with the given >> number of rows and columns >> >> 3. What should matrix(2,3,[1,[2,3],[4,5,6]]) give? >> a) a 2-row 3-column matrix [[1,2,3],[4,5,6]] >> b) raise an error since the nested info doesn't agree with the given >> number of rows and columns > > I would prefer an error to be raised in all cases instead of silently > reshaping my data. > > didier >>
I think an error should be raised in all cases as well. - Robert --~--~---------~--~----~------------~-------~--~----~ To post to this group, send email to sage-devel@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/sage-devel URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---