code for the transpose of a list of lists.



The big speed gain has been made. Probably more useful to move on to
the next super-bad case than to try to shave 5% more off this one....
Especially since the results are implementation-dependent.

          -s

On 2010-06-29, Richard Fateman <fateman at cs.berkeley.edu> wrote:
>  Here's another program to time...
>
> (defun $mtrans(r) ;; r must be a maxima matrix
>
>   (let* ((j (1- (length r)))
>      (k (1- (length (cadr r))))
>      (M (make-array (list  j k) :initial-contents
>             (mapcar #'cdr (cdr r)))))
>     (cons '($matrix simp)
>       (loop for ind2 fixnum from 0 below k collect
>       (cons '(mlist simp)
>         (loop for ind1 fixnum from 0 below j collect
>         (aref M ind1 ind2)))))))
>
> It appears to be slow on GCL, but may be much faster on some other lisps.
>
> I also don't know about optimization settings for GCL etc.
>
> _______________________________________________
> Maxima mailing list
> Maxima at math.utexas.edu
> http://www.math.utexas.edu/mailman/listinfo/maxima
>