(define (rmin v) (let loop ((rmin 0) (i 1)) (if (>= i (vector-length v)) rmin (loop (if (< (vector-ref v i) (vector-ref v rmin)) i rmin) (+ i 1)))))