Changeset 30631 in project


Ignore:
Timestamp:
04/01/14 13:46:00 (7 years ago)
Author:
Ivan Raikov
Message:

parametric-curbe: tweaks to fold functions

Location:
release/4/parametric-curve/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • release/4/parametric-curve/trunk/parametric-curve.scm

    r30630 r30631  
    175175                        (/ (- xmax xmin) (- n 1)))))
    176176         )
    177     (let ((res (g (list-tabulate n (lambda (i) (+ xmin (* dx i)))))))
    178     (f64vector-fold f init res)
     177    (let ((vs (g (list-tabulate n (lambda (i) (+ xmin (* dx i)))))))
     178    (f64vector-fold f init vs)
    179179    )))
    180180
  • release/4/parametric-curve/trunk/tests/run.scm

    r30630 r30631  
    8181(printf "fold my-scaled-c = ~A~%"
    8282        (fold-curve my-scaled-c 5
    83            (list (lambda (x init) (* x 10))
    84                  (lambda (x init) (* x 20))
    85                  (lambda (x init) (* x 30)))
     83           (list (lambda (x init) (cons (* x 10) init))
     84                 (lambda (x init) (cons (* x 20) init))
     85                 (lambda (x init) (cons (* x 30) init)))
    8686           (list '() '() '())
    8787           ))
Note: See TracChangeset for help on using the changeset viewer.