Confusion with 1 x 1 matrices



On 6/10/07, Nikos Apostolakis <nikos.ap at gmail.com> wrote:

> Ok now it makes sense.  I didn't know about scalarmatrixp, thanks
> for pointing it out.  So I guess the computation of "invert(x)"
> involves matrix multiplication while "^^-1" doesn't.  Is there a
> good reason for two different methods for computing the inverse? is
> one method more efficient in certain situations?

The difference between A^^-1 and invert(A) is probably historical
(although I say this without looking at the code).

> > We might consider making the default value of scalarmatrixp equal
> > to false (at present it is true).  I think simplifying 1-element
> > matrices to scalars is too often a bad surprise.
>
> FWIW, I think that "scalarmatrixp : false" is the most sensible
> default.  For sure is the least surprising for the unaware user.

I have made that change in my CVS sandbox and I'll commit it
unless someone makes a case for continuing scalarmatrixp=true.

best
Robert