changeset 86500:83c2e8f0909e

(math-map-binop): New function. (calc-curve-fit): Replace `mapcar*' by `math-map-binop'.
author Jay Belanger <jay.p.belanger@gmail.com>
date Tue, 27 Nov 2007 04:56:53 +0000
parents 8337a257fe94
children 9c534c544c8c
files lisp/calc/calcalg3.el
diffstat 1 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/calc/calcalg3.el	Tue Nov 27 04:53:27 2007 +0000
+++ b/lisp/calc/calcalg3.el	Tue Nov 27 04:56:53 2007 +0000
@@ -43,6 +43,13 @@
 (declare-function math-max-list "calc-arith" (a b))
 
 
+(defun math-map-binop (binop args1 args2)
+  "Apply BINOP to the elements of the lists ARGS1 and ARGS2"
+  (if args1
+      (cons
+       (funcall binop (car args1) (car args2))
+       (funcall 'math-map-binop binop (cdr args1) (cdr args2)))))
+
 (defun calc-find-root (var)
   (interactive "sVariable(s) to solve for: ")
   (calc-slow-wrapper
@@ -250,9 +257,9 @@
                               (nth 1 plot)
                               (cons
                                'vec
-                               (mapcar* 'calcFunc-div
-                                        (cdr (nth 2 plot))
-                                        (cdr (nth 1 plot)))))))
+                               (math-map-binop 'calcFunc-div
+                                               (cdr (nth 2 plot))
+                                               (cdr (nth 1 plot)))))))
               (calc-fit-hubbert-linear-curve func))
 	     ((memq key '(?e ?E))
 	      (calc-get-fit-variables calc-curve-nvars