From: Andreas E. <ar...@us...> - 2013-02-25 16:58:33
|
This is an automated email from the git hooks/post-receive script. It was generated because a ref change was pushed to the repository containing the project "Maxima CAS". The branch, master has been updated via 6a57b9672b1f7fb8dead0912726db3617b3a1063 (commit) from 34d39459bcd5bb20e464bb39e3527b5aa00cf713 (commit) Those revisions listed above that are new to this repository have not appeared on any other notification email; so we list those revisions in full, below. - Log ----------------------------------------------------------------- commit 6a57b9672b1f7fb8dead0912726db3617b3a1063 Author: Andreas Eder (are_muc) <and...@gm...> Date: Sun Feb 24 14:29:53 2013 +0100 use varp instead of an explicit alike1 form where possible diff --git a/src/sin.lisp b/src/sin.lisp index 76b6601..7b5368b 100644 --- a/src/sin.lisp +++ b/src/sin.lisp @@ -38,6 +38,10 @@ ;;; Predicate functions +(declaim (inline varp)) +(defun varp (x) + (alike1 x var)) + (defun integerp1 (x) "Returns 2*x if 2*x is an integer, else nil" (integerp2 (mul2* 2 x))) @@ -53,7 +57,7 @@ ;; This predicate is used with m2 pattern matcher. ;; A rational expression in var. (defun rat8 (ex) - (cond ((or (alike1 ex var) (freevar ex)) + (cond ((or (varp ex) (freevar ex)) t) ((member (caar ex) '(mplus mtimes) :test #'eq) (do ((u (cdr ex) (cdr u))) @@ -78,16 +82,13 @@ (defun freevar (a) (cond ((atom a) (not (eq a var))) - ((alike1 a var) nil) + ((varp a) nil) ((and (not (atom (car a))) (member 'array (cdar a) :test #'eq)) (cond ((freevar (cdr a)) t) (t (merror "~&FREEVAR: variable of integration appeared in subscript.")))) (t (and (freevar (car a)) (freevar (cdr a)))))) -(defun varp (x) - (alike1 x var)) - ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; possibly a bug: For var = x and *d* =3, we have expand(?subst10(x^9 * (x+x^6))) --> x^5+x^4, but @@ -611,7 +612,7 @@ ;; or (), saying this derivative isn't wrt the variable of integration. (defun checkderiv1 (expr wrt old-wrt) - (cond ((alike1 (car wrt) var) + (cond ((varp (car wrt)) (if (equal (cadr wrt) 1) ;Power = 1? (if (null (cddr wrt)) ;single or partial (if (null old-wrt) @@ -702,9 +703,9 @@ (defun rat10 (ex) (cond ((freevar ex) t) - ((alike1 ex var) nil) + ((varp ex) nil) ((eq (caar ex) 'mexpt) - (if (alike1 (cadr ex) var) + (if (varp (cadr ex)) (if (integerp2 (caddr ex)) (setq powerlist (cons (caddr ex) powerlist))) (and (rat10 (cadr ex)) (rat10 (caddr ex))))) ----------------------------------------------------------------------- Summary of changes: src/sin.lisp | 17 +++++++++-------- 1 files changed, 9 insertions(+), 8 deletions(-) hooks/post-receive -- Maxima CAS |