- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 688
 
Closed
Description
Using ZZ(0) as an element of the list passed to block_matrix appears to be a special case somehow and throws an exception rather than creating the matrix seems reasonable to me.
sage: i=MatrixSpace(ZZ,2,2)(1)
sage: i
[1 0]
[0 1]
sage: block_matrix([1,i,1,1])  # this works as I expect
[1 0|1 0]
[0 1|0 1]
[---+---]
[1 0|1 0]
[0 1|0 1]
sage: block_matrix([0,i,1,1])  # this doesn't ... why is 0 special
...
ValueError: Insufficient information to determine dimensions.
This feels to me like a hazardous inconsistency.
Perhaps I should also add that I don't really like that it just blithely assumes I want a square matrix (although I did in my actual usage). Ticket #2429 addresses that issue more wholeheartedly.
Apply:
- attachment: 4492_block_matrix_rebased.patch
 - attachment: trac_4492-block-matrix-reviewer.patch
 - attachment: 4492_typo.patch
 - attachment: trac_4492-doctest-number-field.patch
 
CC: @craigcitro @jasongrout @loefflerd
Component: linear algebra
Author: Willem Jan Palenstijn
Reviewer: Aly Deines, Rob Beezer
Merged: sage-4.6.2.alpha3
Issue created by migration from https://trac.sagemath.org/ticket/4492