anchor.diff:                               (width-of matrix :densep t))))
         (compact (sv-left new-sv) (sv-left sv) #'dense-row-index)
         (compact (sv-right new-sv) (sv-right sv) #'dense-column-index)
  +      new-sv)))
  +
  +(defun expand-sv (sv matrix)
  +  "Take SV that uses dense indices of MATRIX and turn it into one that
  +uses normal indices."
  +  (flet ((expand (target source map)
  +           (loop for i below (length target) do
  +                 (let ((dense-i (funcall map matrix i)))
  +                   (when dense-i
  +                     (setf (aref target i) (aref source dense-i)))))))
  +    (let ((new-sv (create-sv (height-of matrix :densep nil)
  +                             (width-of matrix :densep nil))))
  +      (expand (sv-left new-sv) (sv-left sv) #'dense-row-index)
  +      (expand (sv-right new-sv) (sv-right sv) #'dense-column-index)
         new-sv)))
   
   (defun save-svd (svd filename)
  
positive.code:                             :clip clip :matrix matrix
                              :approximation approximation))
             (add (sv)
               (let ((left (sv-left sv))
                     (right (sv-right sv)))
                 (declare (type single-float-vector approximation))
                 (map-matrix
                  (lambda (row column value i)
                    (declare (ignore value))
                    (let ((row (dense-row-index matrix row))
                          (column (dense-column-index matrix column)))
                      (setf (aref approximation i)
                            (funcall clip
                                     (+ (aref approximation i)
                                        (* (aref left row)
                                           (aref right column)))))))
                  matrix))))
        (loop for sv across svd do
              (add sv))
        (loop for n upfrom (length svd) do
  
negative.code:                                   :normalization-factor normalization-factor
                                    :clip clip
                                    :do-matrix (do-matrix-macro-name matrix)))))
           (adder (compile nil
                           (eval
                            (list 'add-sv-to-approximation
                                  :matrix matrix :clip clip
                                  :do-matrix (do-matrix-macro-name matrix)))))
           (clip (coerce clip 'function)))
      (map-matrix
       (lambda (row column value i)
  