Subject: code for the transpose of a list of lists.
From: Richard Fateman
Date: Mon, 28 Jun 2010 21:37:00 -0700
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.