Comment #5 on issue 2222 by [email protected]: Matrix([Matrix, ...]) should
check the row length of empty matrices
http://code.google.com/p/sympy/issues/detail?id=2222
(I wonder whether such objects are allowed to exist at all
and it probably would be better to raise an exception in this place)
I agree, mathematically the minimal size of Matrix is 1x1.
Now current situation is looked so:
in matrices module:
- Somewhere in places there is exists just shape checking (rows>0,cols>0):
in some constructors functions (f.e. zeros with the help of `_dims_to_nm`)
- In main constructor of Matrix there are no, more over # Empty Matrix is
admitted.
- in some methods there are no too, especially `__getitem__` and
`submatrix` which produce [p:q] behaviour.
In sympy:
- somewhere Empty Matrix or matrices where zero rows number or columns are
admitted. I do not know where exactly.
The ideal solution, in my opinion, is that:
(1) do not admit existence of Matrix with incorrect form.
(2) if other forms are really needed then the separate object must be
present for it (Matrix-like or not).
But I can't determine exactly what aims of incorrect shapes are for.
I supposed for [p:q] operations and others.
So I offer this variant of movements: to carry out an experiment.
You can try achieve ideal solution (part 1) and look what tests are broken,
or what functionality became insufficient. Then push it in your current
pull request (even if tests are broken)
After that it will be possible to continue to get the estimates or to
discuss what to do with (part 2) or may be others variants will arises.
Remarks:
I think it is enough to raise ShapeError (not
NonintegerNumberOfDimensionException) in constructors and in functions that
written above.
From one's part, others will check and will give their own estimates.
--
You received this message because you are subscribed to the Google Groups
"sympy-issues" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sympy-issues?hl=en.