## [Maxima-commits] CVS: maxima/share/contrib/diffequations odelin.lisp, 1.2, 1.3 polynomialp.lisp, 1.1, NONE

 [Maxima-commits] CVS: maxima/share/contrib/diffequations odelin.lisp, 1.2, 1.3 polynomialp.lisp, 1.1, NONE From: David Billinghurst - 2007-01-30 13:39:10 ```Update of /cvsroot/maxima/maxima/share/contrib/diffequations In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv4582 Modified Files: odelin.lisp Removed Files: polynomialp.lisp Log Message: Delete file polynomialp.lisp that defines function \$polynomialp, as there is already a file defining function of same name in share/linearalgebra. Rename function defined here to ode-polynomialp, include it in odelin.lisp and update usage. Index: odelin.lisp =================================================================== RCS file: /cvsroot/maxima/maxima/share/contrib/diffequations/odelin.lisp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- odelin.lisp 29 Jan 2007 12:38:30 -0000 1.2 +++ odelin.lisp 30 Jan 2007 13:39:04 -0000 1.3 @@ -38,12 +38,23 @@ (defmvar \$de_solver_is_loquacious t) +(defun ode-polynomialp (p x) + (setq p (\$ratdisrep p)) + (or + (\$freeof x p) + (like p x) + (and (or (mtimesp p) (mplusp p)) + (every #'(lambda (s) (ode-polynomialp s x)) (margs p))) + (and (mexptp p) (ode-polynomialp (car (margs p)) x) + (integerp (cadr (margs p))) + (> (cadr (margs p)) 0)))) + (defun \$okay (de y x) (let ((okay t)) (setq de (require-linear-homogeneous-de de y x)) (dolist (p de) - (setq okay (and okay (\$polynomialp (\$ratnumer p) x) - (\$polynomialp (\$ratnumer p) x)))) + (setq okay (and okay (ode-polynomialp (\$ratnumer p) x) + (ode-polynomialp (\$ratnumer p) x)))) okay)) (defun \$rerat (dirtyrat) @@ -146,10 +157,10 @@ (setq p1 (div p1 p2)) (setq p0 (div p0 p2)) - (if (not (and (\$polynomialp (\$ratnumer p1) x) - (\$polynomialp (\$ratdenom p1) x) - (\$polynomialp (\$ratnumer p0) x) - (\$polynomialp (\$ratdenom p0) x))) + (if (not (and (ode-polynomialp (\$ratnumer p1) x) + (ode-polynomialp (\$ratdenom p1) x) + (ode-polynomialp (\$ratnumer p0) x) + (ode-polynomialp (\$ratdenom p0) x))) (setq ode-methods nil)) (setq p (add p0 (div (\$diff p1 x) -2) (mul p1 p1 (div -1 4)))) --- polynomialp.lisp DELETED --- ```

 [Maxima-commits] CVS: maxima/share/contrib/diffequations odelin.lisp, 1.2, 1.3 polynomialp.lisp, 1.1, NONE From: David Billinghurst - 2007-01-30 13:39:10 ```Update of /cvsroot/maxima/maxima/share/contrib/diffequations In directory sc8-pr-cvs7.sourceforge.net:/tmp/cvs-serv4582 Modified Files: odelin.lisp Removed Files: polynomialp.lisp Log Message: Delete file polynomialp.lisp that defines function \$polynomialp, as there is already a file defining function of same name in share/linearalgebra. Rename function defined here to ode-polynomialp, include it in odelin.lisp and update usage. Index: odelin.lisp =================================================================== RCS file: /cvsroot/maxima/maxima/share/contrib/diffequations/odelin.lisp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- odelin.lisp 29 Jan 2007 12:38:30 -0000 1.2 +++ odelin.lisp 30 Jan 2007 13:39:04 -0000 1.3 @@ -38,12 +38,23 @@ (defmvar \$de_solver_is_loquacious t) +(defun ode-polynomialp (p x) + (setq p (\$ratdisrep p)) + (or + (\$freeof x p) + (like p x) + (and (or (mtimesp p) (mplusp p)) + (every #'(lambda (s) (ode-polynomialp s x)) (margs p))) + (and (mexptp p) (ode-polynomialp (car (margs p)) x) + (integerp (cadr (margs p))) + (> (cadr (margs p)) 0)))) + (defun \$okay (de y x) (let ((okay t)) (setq de (require-linear-homogeneous-de de y x)) (dolist (p de) - (setq okay (and okay (\$polynomialp (\$ratnumer p) x) - (\$polynomialp (\$ratnumer p) x)))) + (setq okay (and okay (ode-polynomialp (\$ratnumer p) x) + (ode-polynomialp (\$ratnumer p) x)))) okay)) (defun \$rerat (dirtyrat) @@ -146,10 +157,10 @@ (setq p1 (div p1 p2)) (setq p0 (div p0 p2)) - (if (not (and (\$polynomialp (\$ratnumer p1) x) - (\$polynomialp (\$ratdenom p1) x) - (\$polynomialp (\$ratnumer p0) x) - (\$polynomialp (\$ratdenom p0) x))) + (if (not (and (ode-polynomialp (\$ratnumer p1) x) + (ode-polynomialp (\$ratdenom p1) x) + (ode-polynomialp (\$ratnumer p0) x) + (ode-polynomialp (\$ratdenom p0) x))) (setq ode-methods nil)) (setq p (add p0 (div (\$diff p1 x) -2) (mul p1 p1 (div -1 4)))) --- polynomialp.lisp DELETED --- ```