Bug #956
determinant: fails for 0x0 matrix (SEGV)
Description
The following triggers a SEGV:
Id0 := IdentityMat(ZZ,0); // works OK det(Id0);
Related issues
History
#1 Updated by John Abbott over 7 years ago
- Related to Feature #11: Bareiss algorithm added
#2 Updated by John Abbott over 7 years ago
- Status changed from New to Resolved
- Assignee set to John Abbott
- % Done changed from 0 to 80
The problem was simply that the generic Bariess code failed (on the very last line) when given a 0x0 matrix.
I have added special case code for 0x0 and 1x1 matrices. Actually I added this code several times: is it right that it should be added so often?
This case is now effectively tested by the new test-MatrixSpecial2.C
#3 Updated by John Abbott over 7 years ago
I am still puzzled about how best to handle the trivial cases (0x0 and 1x1 matrices).
The relevant code is only 2 lines long, but it still bothers me to have several copies. What is the best way to achieve this?
[And how can I be sure that I have not forgotten another place where those special cases should be dealt with?]
Any function which is user accessible should certainly handle those inputs. Other fns should either handle those cases or give error or assert that they do not occur.
#4 Updated by John Abbott over 7 years ago
- Status changed from Resolved to Closed
- % Done changed from 80 to 100
#5 Updated by Anna Maria Bigatti almost 7 years ago
- Estimated time set to 0.51 h