mtranspose   xtlang


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/libs/core/math.xtm

Implementation

(bind-func mtranspose
  (lambda (m1:double* nrows:i64 ncols:i64 result:double*)
    (let ((i 0) (j 0))
      (dotimes (i nrows)
        (dotimes (j ncols)
          (pset! result (+ (* j ncols) i)
                 (pref m1 (+ (* i ncols) j)))))
      result)))


Back to Index