srfi-4-utils contains a set of convenience procedures for SRFI-4 vectors: fold, map, quick-sort!.
For each value of TAG in { s8, u8, s16, u16, s32, u32, f32, f64 }, the following procedures are defined:
csi> (f64vector-map (lambda (v) (* 2 v)) (f64vector 1 2 3)) -> #f64(2.0 4.0 6.0) csi> (f64vector-fold (lambda (v ax) (+ v ax)) (f64vector 1 2 3) 0) -> 6.0 ;; input vector is modified csi> (f64vector-quick-sort! (f64vector 1 4 2 3) (lambda (i1 v1 i2 v2) (< v1 v2))) #f64(1.0 2.0 3.0 4.0)
Copyright 2007 Ivan Raikov and the Okinawa Institute of Science and Technology This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. A full copy of the GPL license can be found at <http://www.gnu.org/licenses/>.