Size of a matrix



On Sat, 2004-01-31 at 23:08, Stavros Macrakis wrote:
> Dan, Richard,
> 
> Maxima certainly has a lot of weird definitions.  But then, so do
> Matlab/Octave.  Dan was complaining about 'length' in Maxima.  Do you
> know what length(matrix) does in Matlab/Octave?:
> 
>    For matrix objects, the length is the number of rows or
>    columns, whichever is greater

Indeed, I have been bitten by this ill-conceived definition. It would be
an excellent counter-example to any argument for simply copying the
Matlab model.

> So much for Matlab as a model.

I do not, however, think that the above problem is an argument for
totally ignoring the Matlab model.

>   Besides individual weirdnesses like
> this, remember that Matlab specializes in *numeric* *matrix*
> calculations, so its notation is not likely to make sense for *symbolic*
> calculations in a *variety* of domains.  To take a trivial example,
> Matlab doesn't distinguish between scalar and matrix multiplication,
> because all objects have known values.
> 
> That said, Maxima as it stands clearly has a lot of messy areas.  I
> don't think we can fix them by changing one function here, one function
> there, and adding a few new features.  Design is work.

OK, I just wrote "you are absolutely right," then erased it. I agree
that there are many messy areas in Maxima that need a redesign. Since
design really is work, however, I don't think we can argue that adding a
few fixes in the meantime won't be helpful. It is difficult to maintain
the appropriate balance between large and small fixes.

Having said all that, I would be happy to see work on a redesign of the
matrix systems in Maxima. I think such a design should consider:
	1) The design of matrix operations in existing systems.
		a) Symbolic systems such as Mathematica and Maple.
		b) Numerical systems such as Matlab, Fortran 77 and 	  	   Fortran 90.
	2) The importance of adding calls to foreign functions for 	  
numerical matrix operations. LAPACK is the 500-pound gorilla
	   here, but there are others. Matlisp is an existing 	  	  
implementation of code that calls such functions from Lisp.

--Jim