This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

matrix'


There is a function TRANSPOSE-ARRAY, which accepts (multidimensional)
arrays, rather than lists:

(define (matrix' m)
  (if (= 2 (array-rank m))
      (transpose-array m 1 0)
      (throw 'not-a-matrix m)))

TRANSPOSE-ARRAY returns an array sharing contents with its first argument.
Cost does not depend on the size of the array, but altering the result
will alter the original argument.