Changeset 6046 in project


Ignore:
Timestamp:
09/17/07 08:10:06 (12 years ago)
Author:
Ivan Raikov
Message:

Migrated matrix-fold/map to srfi-4-utils.

Location:
matrix-utils/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • matrix-utils/trunk/matrix-utils-eggdoc.scm

    r5977 r6046  
    1313
    1414     (history
     15      (version "1.5" "Migrated matrix-fold/map to srfi-4-utils")
    1516      (version "1.4" "Added define-matrix-fold")
    1617      (version "1.3" "Added define-matrix-map")
     
    212213                        (describe "u32"  ("Unsigned 32-bit integer")))))
    213214
    214                   (macro "(define-matrix-fold type)"
    215                     (p "Creates procedure " (tt "MATRIX-FOLD:: F * M * X0 -> X")
    216                        " that, given an input matrix "
    217                        (tt "M") " procedure " (tt "F") ", and initial value " (tt "X0") ", "
    218                        "returns the result of performing the fold operation on the elements "
    219                        " of the matrix, starting with the given initial value. "
    220                        (tt "TYPE") " is one of the following: "
    221                        (symbol-table
    222                         (describe "f64"  ("Double precision IEEE floating point"))
    223                         (describe "f32"  ("Single precision IEEE floating point"))
    224                         (describe "s32"  ("Signed 32-bit integer"))
    225                         (describe "u32"  ("Unsigned 32-bit integer")))))
    226 
    227215                  ))
    228216
  • matrix-utils/trunk/matrix-utils.scm

    r5977 r6046  
    2727(require-extension blas)
    2828(require-extension matrix-utils-support)
    29 
    30 (define-macro (define-matrix-fold type)
    31   (case type
    32     ((f64)    `(define (matrix-fold f v x0)
    33                  (fold-ec x0 (:f64vector x v) x f)))
    34     ((f32)    `(define (matrix-fold f v x0)
    35                  (fold-ec x0 (:f32vector x v) x f)))
    36     ((s32)    `(define (matrix-fold f v x0)
    37                  (fold-ec x0 (:s32vector x v) x f)))
    38     ((u32)    `(define (matrix-fold f v x0)
    39                  (fold-ec x0 (:u32vector x v) x f)))
    40     (else  `(matrix-utils:error 'define-matrix-fold "matrix-fold does not support type " ,type))))
    41 
    42 (define-macro (define-matrix-map type)
    43   (case type
    44     ((f64)    `(define (matrix-map f v)
    45                  (f64vector-of-length-ec (f64vector-length v) (:f64vector x v) (f x))))
    46     ((f32)    `(define (matrix-map f v)
    47                  (f32vector-of-length-ec (f32vector-length v) (:f32vector x v) (f x))))
    48     ((s32)    `(define (matrix-map f v)
    49                  (s32vector-of-length-ec (s32vector-length v) (:s32vector x v) (f x))))
    50     ((u32)    `(define (matrix-map f v)
    51                  (u32vector-of-length-ec (u32vector-length v) (:u32vector x v) (f x))))
    52     (else  `(matrix-utils:error 'define-matrix-map "matrix-map does not support type " ,type))))
    5329
    5430
  • matrix-utils/trunk/matrix-utils.setup

    r5977 r6046  
    1212 `("matrix-utils.scm" "matrix-utils-support.so" "matrix-utils.html"
    1313   ,@(if has-exports? '("matrix-utils-support.exports") (list)) )
    14  `((version 1.4)
     14 `((version 1.5)
    1515   (syntax)
    1616   (require-at-runtime matrix-utils-support)
Note: See TracChangeset for help on using the changeset viewer.