Bug #1014
RowMat, ColMat with arg an empty list/vector
Description
What should RowMat
and ColMat
do if given am empty list/vector as argument?
Related issues
History
#1 Updated by John Abbott about 7 years ago
- % Done changed from 0 to 10
In CoCoA-5 one can call RowMat([])
and ColMat([])
to produce a matrix 1x0 or 0x1.
In CoCoALib a similar call produces an error ("empty list").
These two behaviours are incompatible: which is the "correct" (desired?) behaviour?
#2 Updated by John Abbott about 7 years ago
At the moment JAA thinks that giving an error is probably better.
Is there a situation where one might reasonably want to convert an empty list/vector into a row/column matrix? Or is it much more likely that some earlier program error has produced an empty list/vector, and this should be signalled when calling RowMat
or ColMat
?
This might be mildly related to issue #202: what happens if a user asks for the n-th row of an n-by-0 matrix? The result should be a 1-by-0 matrix, I suppose.
#3 Updated by John Abbott about 7 years ago
- Related to Feature #202: MatrixView/function for viewing a single row or column (RowMat, ColMat) added
#4 Updated by John Abbott about 7 years ago
- Status changed from New to In Progress
Another (mild?) incompatibility is that in CoCoA-5 RowMat
and ColMat
accept as input lists of INT and/or RAT.
In CoCoALib the input has to be a vector<RingElem>
.
Certainly the CoCoA-5 approach is convenient in an "informal" interactive context. Is such an "informal" interface desirable in CoCoALib too?