diff options
| author | Jay Belanger | 2007-11-27 04:56:53 +0000 |
|---|---|---|
| committer | Jay Belanger | 2007-11-27 04:56:53 +0000 |
| commit | e5a5704e499899fa73aa0d93613d140b4d4fb7c4 (patch) | |
| tree | 0907fbcee9b49bb748698e9d0f9e121d9c003951 | |
| parent | ae51ae1108370a4dcce5368cc5399ce57694db8c (diff) | |
| download | emacs-e5a5704e499899fa73aa0d93613d140b4d4fb7c4.tar.gz emacs-e5a5704e499899fa73aa0d93613d140b4d4fb7c4.zip | |
(math-map-binop): New function.
(calc-curve-fit): Replace `mapcar*' by `math-map-binop'.
| -rw-r--r-- | lisp/calc/calcalg3.el | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/lisp/calc/calcalg3.el b/lisp/calc/calcalg3.el index 5d129b37f7a..374b0487cfe 100644 --- a/lisp/calc/calcalg3.el +++ b/lisp/calc/calcalg3.el | |||
| @@ -43,6 +43,13 @@ | |||
| 43 | (declare-function math-max-list "calc-arith" (a b)) | 43 | (declare-function math-max-list "calc-arith" (a b)) |
| 44 | 44 | ||
| 45 | 45 | ||
| 46 | (defun math-map-binop (binop args1 args2) | ||
| 47 | "Apply BINOP to the elements of the lists ARGS1 and ARGS2" | ||
| 48 | (if args1 | ||
| 49 | (cons | ||
| 50 | (funcall binop (car args1) (car args2)) | ||
| 51 | (funcall 'math-map-binop binop (cdr args1) (cdr args2))))) | ||
| 52 | |||
| 46 | (defun calc-find-root (var) | 53 | (defun calc-find-root (var) |
| 47 | (interactive "sVariable(s) to solve for: ") | 54 | (interactive "sVariable(s) to solve for: ") |
| 48 | (calc-slow-wrapper | 55 | (calc-slow-wrapper |
| @@ -250,9 +257,9 @@ | |||
| 250 | (nth 1 plot) | 257 | (nth 1 plot) |
| 251 | (cons | 258 | (cons |
| 252 | 'vec | 259 | 'vec |
| 253 | (mapcar* 'calcFunc-div | 260 | (math-map-binop 'calcFunc-div |
| 254 | (cdr (nth 2 plot)) | 261 | (cdr (nth 2 plot)) |
| 255 | (cdr (nth 1 plot))))))) | 262 | (cdr (nth 1 plot))))))) |
| 256 | (calc-fit-hubbert-linear-curve func)) | 263 | (calc-fit-hubbert-linear-curve func)) |
| 257 | ((memq key '(?e ?E)) | 264 | ((memq key '(?e ?E)) |
| 258 | (calc-get-fit-variables calc-curve-nvars | 265 | (calc-get-fit-variables calc-curve-nvars |