anchor.diff:  	 sum (aref M i i))))
   
   (defun transpose (matrix)
  -  (let ((result (make-array (nreverse (array-dimensions matrix)))))
  -    (do-matrix (result (i j))
  -      (setf (aref result i j) (aref matrix j i)))
  -    result))
  +  (do-matrix-with-result (result (i j) result (nreverse (array-dimensions matrix)))
  +    (setf (aref result i j) (aref matrix j i))))
   
   (defgeneric .+ (A B)
     (:documentation "Matrix addition function, will also add single numbers elementwise to the matrix."))
  
positive.code: (defgeneric ./ (A B))
  
  (defmethod ./ ((A simple-array) (B number))
    (with-result (result (array-dimensions A))
      (do-matrix (result subs)
        (setf (apply #'aref result subs) (/ (apply #'aref A subs) B)))))
  
  (defmethod ./ ((A vector) (B number))
    (with-result (result (list (length A)))
      (do-matrix (A (i))
        (setf (aref result i) (/ (aref A i) B)))))
  
  (defmethod ./ ((A number) (B number))
    (/ A B))
  
negative.code: 
  (defun minor-matrix (matrix &rest subscripts)
    ;; Result matrix is of dimensions N-1xN-1 compared to the original matrix
    (let ((row-major 0))
      (do-matrix-with-result (matrix indices result (mapcar #'1- (array-dimensions matrix)) (array-element-type matrix))
        ;; Don't copy a number if any of the indices matches a sprcified subscript
        (unless (reduce (lambda (a b) (or a b)) (mapcar #'= indices subscripts))
  	(setf (row-major-aref result row-major) (apply #'aref matrix indices))
  	(incf row-major)))))
  
  (defun random-matrix (&rest dimensions)
    (do-matrix-with-result (result subscripts result dimensions)
      (setf (apply #'aref result subscripts) (random 1.0d0))))
  
  (defun mapply (func data)
    (with-result (result (array-dimensions data))
  