]> code.delx.au - gnu-emacs/blobdiff - lisp/calc/calcalg3.el
(calc-embedded-make-info): Use `calc-embedded-word-regexp' to find word.
[gnu-emacs] / lisp / calc / calcalg3.el
index 5aa410be19e675cd0595f50bbc346072c3ead80a..421197ab01af9b673e7429b10921944417bffb34 100644 (file)
@@ -1,17 +1,17 @@
 ;;; calcalg3.el --- more algebraic functions for Calc
 
 ;; Copyright (C) 1990, 1991, 1992, 1993, 2001, 2002, 2003, 2004,
-;;   2005, 2006, 2007 Free Software Foundation, Inc.
+;;   2005, 2006, 2007, 2008 Free Software Foundation, Inc.
 
 ;; Author: David Gillespie <daveg@synaptics.com>
 ;; Maintainer: Jay Belanger <jay.p.belanger@gmail.com>
 
 ;; This file is part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify
+;; GNU Emacs 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, or (at your option)
-;; any later version.
+;; the Free Software Foundation, either version 3 of the License, or
+;; (at your option) any later version.
 
 ;; GNU Emacs is distributed in the hope that it will be useful,
 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
@@ -19,9 +19,7 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the
-;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
-;; Boston, MA 02110-1301, USA.
+;; along with GNU Emacs.  If not, see <http://www.gnu.org/licenses/>.
 
 ;;; Commentary:
 
 (require 'calc-ext)
 (require 'calc-macs)
 
+;; Declare functions which are defined elsewhere.
+(declare-function calc-fit-s-shaped-logistic-curve "calc-nlfit" (arg))
+(declare-function calc-fit-bell-shaped-logistic-curve "calc-nlfit" (arg))
+(declare-function calc-fit-hubbert-linear-curve "calc-nlfit" (&optional sdv))
+(declare-function calc-graph-add-curve "calc-graph" (xdata ydata &optional zdata))
+(declare-function calc-graph-lookup "calc-graph" (thing))
+(declare-function calc-graph-set-styles "calc-graph" (lines points &optional yerr))
+(declare-function math-min-list "calc-arith" (a b))
+(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
                               (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 
              (calc-record (calc-normalize calc-fit-to-trail) "parm"))))
   (when plot
     (if (stringp plot)
-        (message plot)
+        (message "%s" plot)
       (let ((calc-graph-no-auto-view t))
         (calc-graph-delete t)
         (calc-graph-add-curve
 
 (provide 'calcalg3)
 
-;;; arch-tag: ff9f2920-8111-48b5-b3fa-b0682c3e44a6
+;; arch-tag: ff9f2920-8111-48b5-b3fa-b0682c3e44a6
 ;;; calcalg3.el ends here