aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJay Belanger2010-10-13 22:14:38 -0500
committerJay Belanger2010-10-13 22:14:38 -0500
commita974dcf2bba7eb9e3f4a407cc2ff1b714e6e7d2f (patch)
treec90716599a3332d0f483bd0ca5e68ed4025fe8c2
parent24f981c9f4e15f42d4b569919297c4781a6fc51d (diff)
downloademacs-a974dcf2bba7eb9e3f4a407cc2ff1b714e6e7d2f.tar.gz
emacs-a974dcf2bba7eb9e3f4a407cc2ff1b714e6e7d2f.zip
calc-alg.el (math-var): Renamed from `var'.
(math-is-polynomial, math-is-poly-rec): Replace `var' with `math-var'. calcalg2.el (math-var): Renamed from `var'. (calcFunc-table, math-scan-for-limits): Replace `var' with `math-var'.
-rw-r--r--lisp/ChangeLog10
-rw-r--r--lisp/calc/calc-alg.el26
-rw-r--r--lisp/calc/calcalg2.el14
3 files changed, 30 insertions, 20 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 691c4c1de36..0d6b007f3b3 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,13 @@
12010-10-14 Jay Belanger <jay.p.belanger@gmail.com>
2
3 * calc/calc-alg.el (math-var): Renamed from `var'.
4 (math-is-polynomial, math-is-poly-rec): Replace `var'
5 with `math-var'.
6
7 * calc/calcalg2.el (math-var): Renamed from `var'.
8 (calcFunc-table, math-scan-for-limits): Replace `var'
9 with `math-var'.
10
12010-10-13 Glenn Morris <rgm@gnu.org> 112010-10-13 Glenn Morris <rgm@gnu.org>
2 12
3 * subr.el (last): Deal with dotted lists (reported in bug#7174). 13 * subr.el (last): Deal with dotted lists (reported in bug#7174).
diff --git a/lisp/calc/calc-alg.el b/lisp/calc/calc-alg.el
index 6a85be14aeb..47cdae52a13 100644
--- a/lisp/calc/calc-alg.el
+++ b/lisp/calc/calc-alg.el
@@ -1659,11 +1659,11 @@
1659;; math-is-poly-rec. 1659;; math-is-poly-rec.
1660(defvar math-is-poly-degree) 1660(defvar math-is-poly-degree)
1661(defvar math-is-poly-loose) 1661(defvar math-is-poly-loose)
1662(defvar var) 1662(defvar math-var)
1663 1663
1664(defun math-is-polynomial (expr var &optional math-is-poly-degree math-is-poly-loose) 1664(defun math-is-polynomial (expr math-var &optional math-is-poly-degree math-is-poly-loose)
1665 (let* ((math-poly-base-variable (if math-is-poly-loose 1665 (let* ((math-poly-base-variable (if math-is-poly-loose
1666 (if (eq math-is-poly-loose 'gen) var '(var XXX XXX)) 1666 (if (eq math-is-poly-loose 'gen) math-var '(var XXX XXX))
1667 math-poly-base-variable)) 1667 math-poly-base-variable))
1668 (poly (math-is-poly-rec expr math-poly-neg-powers))) 1668 (poly (math-is-poly-rec expr math-poly-neg-powers)))
1669 (and (or (null math-is-poly-degree) 1669 (and (or (null math-is-poly-degree)
@@ -1672,11 +1672,11 @@
1672 1672
1673(defun math-is-poly-rec (expr negpow) 1673(defun math-is-poly-rec (expr negpow)
1674 (math-poly-simplify 1674 (math-poly-simplify
1675 (or (cond ((or (equal expr var) 1675 (or (cond ((or (equal expr math-var)
1676 (eq (car-safe expr) '^)) 1676 (eq (car-safe expr) '^))
1677 (let ((pow 1) 1677 (let ((pow 1)
1678 (expr expr)) 1678 (expr expr))
1679 (or (equal expr var) 1679 (or (equal expr math-var)
1680 (setq pow (nth 2 expr) 1680 (setq pow (nth 2 expr)
1681 expr (nth 1 expr))) 1681 expr (nth 1 expr)))
1682 (or (eq math-poly-mult-powers 1) 1682 (or (eq math-poly-mult-powers 1)
@@ -1690,7 +1690,7 @@
1690 (equal math-poly-mult-powers 1690 (equal math-poly-mult-powers
1691 (nth 1 m)) 1691 (nth 1 m))
1692 (setq math-poly-mult-powers (nth 1 m))) 1692 (setq math-poly-mult-powers (nth 1 m)))
1693 (or (equal expr var) 1693 (or (equal expr math-var)
1694 (eq math-poly-mult-powers 1)) 1694 (eq math-poly-mult-powers 1))
1695 (car m))))) 1695 (car m)))))
1696 (if (consp pow) 1696 (if (consp pow)
@@ -1698,7 +1698,7 @@
1698 (setq pow (math-to-simple-fraction pow)) 1698 (setq pow (math-to-simple-fraction pow))
1699 (and (eq (car-safe pow) 'frac) 1699 (and (eq (car-safe pow) 'frac)
1700 math-poly-frac-powers 1700 math-poly-frac-powers
1701 (equal expr var) 1701 (equal expr math-var)
1702 (setq math-poly-frac-powers 1702 (setq math-poly-frac-powers
1703 (calcFunc-lcm math-poly-frac-powers 1703 (calcFunc-lcm math-poly-frac-powers
1704 (nth 2 pow)))))) 1704 (nth 2 pow))))))
@@ -1706,10 +1706,10 @@
1706 (setq pow (math-mul pow math-poly-frac-powers))) 1706 (setq pow (math-mul pow math-poly-frac-powers)))
1707 (if (integerp pow) 1707 (if (integerp pow)
1708 (if (and (= pow 1) 1708 (if (and (= pow 1)
1709 (equal expr var)) 1709 (equal expr math-var))
1710 (list 0 1) 1710 (list 0 1)
1711 (if (natnump pow) 1711 (if (natnump pow)
1712 (let ((p1 (if (equal expr var) 1712 (let ((p1 (if (equal expr math-var)
1713 (list 0 1) 1713 (list 0 1)
1714 (math-is-poly-rec expr nil))) 1714 (math-is-poly-rec expr nil)))
1715 (n pow) 1715 (n pow)
@@ -1749,7 +1749,7 @@
1749 math-is-poly-degree)) 1749 math-is-poly-degree))
1750 (math-poly-mul p1 p2)))))) 1750 (math-poly-mul p1 p2))))))
1751 ((eq (car expr) '/) 1751 ((eq (car expr) '/)
1752 (and (or (not (math-poly-depends (nth 2 expr) var)) 1752 (and (or (not (math-poly-depends (nth 2 expr) math-var))
1753 (and negpow 1753 (and negpow
1754 (math-is-poly-rec (nth 2 expr) nil) 1754 (math-is-poly-rec (nth 2 expr) nil)
1755 (setq math-poly-neg-powers 1755 (setq math-poly-neg-powers
@@ -1759,13 +1759,13 @@
1759 (mapcar (function (lambda (x) (math-div x (nth 2 expr)))) 1759 (mapcar (function (lambda (x) (math-div x (nth 2 expr))))
1760 p1)))) 1760 p1))))
1761 ((and (eq (car expr) 'calcFunc-exp) 1761 ((and (eq (car expr) 'calcFunc-exp)
1762 (equal var '(var e var-e))) 1762 (equal math-var '(var e var-e)))
1763 (math-is-poly-rec (list '^ var (nth 1 expr)) negpow)) 1763 (math-is-poly-rec (list '^ math-var (nth 1 expr)) negpow))
1764 ((and (eq (car expr) 'calcFunc-sqrt) 1764 ((and (eq (car expr) 'calcFunc-sqrt)
1765 math-poly-frac-powers) 1765 math-poly-frac-powers)
1766 (math-is-poly-rec (list '^ (nth 1 expr) '(frac 1 2)) negpow)) 1766 (math-is-poly-rec (list '^ (nth 1 expr) '(frac 1 2)) negpow))
1767 (t nil)) 1767 (t nil))
1768 (and (or (not (math-poly-depends expr var)) 1768 (and (or (not (math-poly-depends expr math-var))
1769 math-is-poly-loose) 1769 math-is-poly-loose)
1770 (not (eq (car expr) 'vec)) 1770 (not (eq (car expr) 'vec))
1771 (list expr))))) 1771 (list expr)))))
diff --git a/lisp/calc/calcalg2.el b/lisp/calc/calcalg2.el
index 2b45ce1b2f0..4bee751ad41 100644
--- a/lisp/calc/calcalg2.el
+++ b/lisp/calc/calcalg2.el
@@ -1886,9 +1886,9 @@
1886;; math-scan-for-limits. 1886;; math-scan-for-limits.
1887(defvar calc-low) 1887(defvar calc-low)
1888(defvar calc-high) 1888(defvar calc-high)
1889(defvar var) 1889(defvar math-var)
1890 1890
1891(defun calcFunc-table (expr var &optional calc-low calc-high step) 1891(defun calcFunc-table (expr math-var &optional calc-low calc-high step)
1892 (or calc-low 1892 (or calc-low
1893 (setq calc-low '(neg (var inf var-inf)) calc-high '(var inf var-inf))) 1893 (setq calc-low '(neg (var inf var-inf)) calc-high '(var inf var-inf)))
1894 (or calc-high (setq calc-high calc-low calc-low 1)) 1894 (or calc-high (setq calc-high calc-low calc-low 1))
@@ -1917,7 +1917,7 @@
1917 (math-working-step-2 (1+ count)) 1917 (math-working-step-2 (1+ count))
1918 (math-working-step 0)) 1918 (math-working-step 0))
1919 (setq expr (math-evaluate-expr 1919 (setq expr (math-evaluate-expr
1920 (math-expr-subst expr var '(var DUMMY var-DUMMY)))) 1920 (math-expr-subst expr math-var '(var DUMMY var-DUMMY))))
1921 (while (>= count 0) 1921 (while (>= count 0)
1922 (setq math-working-step (1+ math-working-step) 1922 (setq math-working-step (1+ math-working-step)
1923 var-DUMMY calc-low 1923 var-DUMMY calc-low
@@ -1940,7 +1940,7 @@
1940 (calc-record-why 'integerp calc-high)) 1940 (calc-record-why 'integerp calc-high))
1941 (calc-record-why 'integerp calc-low))) 1941 (calc-record-why 'integerp calc-low)))
1942 (append (list (or math-tabulate-function 'calcFunc-table) 1942 (append (list (or math-tabulate-function 'calcFunc-table)
1943 expr var) 1943 expr math-var)
1944 (and (not (and (equal calc-low '(neg (var inf var-inf))) 1944 (and (not (and (equal calc-low '(neg (var inf var-inf)))
1945 (equal calc-high '(var inf var-inf)))) 1945 (equal calc-high '(var inf var-inf))))
1946 (list calc-low calc-high)) 1946 (list calc-low calc-high))
@@ -1950,11 +1950,11 @@
1950 (cond ((Math-primp x)) 1950 (cond ((Math-primp x))
1951 ((and (eq (car x) 'calcFunc-subscr) 1951 ((and (eq (car x) 'calcFunc-subscr)
1952 (Math-vectorp (nth 1 x)) 1952 (Math-vectorp (nth 1 x))
1953 (math-expr-contains (nth 2 x) var)) 1953 (math-expr-contains (nth 2 x) math-var))
1954 (let* ((calc-next-why nil) 1954 (let* ((calc-next-why nil)
1955 (low-val (math-solve-for (nth 2 x) 1 var nil)) 1955 (low-val (math-solve-for (nth 2 x) 1 math-var nil))
1956 (high-val (math-solve-for (nth 2 x) (1- (length (nth 1 x))) 1956 (high-val (math-solve-for (nth 2 x) (1- (length (nth 1 x)))
1957 var nil)) 1957 math-var nil))
1958 temp) 1958 temp)
1959 (and low-val (math-realp low-val) 1959 (and low-val (math-realp low-val)
1960 high-val (math-realp high-val)) 1960 high-val (math-realp high-val))