| Description: |
Although one can create a one-column matrix using "mkMatrix", the "shape" proc incorrectly identifies it as a vector. As a result, other procs that expect matrix arguments may fail. For example, statements such as:
foreach {nrows ncols} [shape $matrix] {break}
will return only one dimension, leaving "ncols" undefined.
I think that this is due to Tcl's inability to distinguish a single element list such as {1.0} from a non-list value. Assuming this to be true, I don't see an easy fix. Perhaps all that can be done is to add a warning/alert to the documentation?
|