comparison lisp/calc/calc-poly.el @ 81610:17b60d2a64ca

(math-padded-polynomial) (math-partial-fractions): Add some function comments.
author David Kastrup <dak@gnu.org>
date Mon, 25 Jun 2007 20:55:56 +0000
parents 1154f082efd9
children b98604865ea0 988f1edc9674
comparison
equal deleted inserted replaced
81609:7e640eac2dcb 81610:17b60d2a64ca
980 (math-partial-fractions r den var)) 980 (math-partial-fractions r den var))
981 (math-div r den))))))) 981 (math-div r den)))))))
982 982
983 983
984 (defun math-padded-polynomial (expr var deg) 984 (defun math-padded-polynomial (expr var deg)
985 "Return a polynomial as list of coefficients.
986 If EXPR is of the form \"a + bx + cx^2 + ...\" in the variable VAR, return
987 the list (a b c ...) with at least DEG elements, else return NIL."
985 (let ((p (math-is-polynomial expr var deg))) 988 (let ((p (math-is-polynomial expr var deg)))
986 (append p (make-list (- deg (length p)) 0)))) 989 (append p (make-list (- deg (length p)) 0))))
987 990
988 (defun math-partial-fractions (r den var) 991 (defun math-partial-fractions (r den var)
992 "Return R divided by DEN expressed in partial fractions of VAR.
993 All whole factors of DEN have already been split off from R.
994 If no partial fraction representation can be found, return nil."
989 (let* ((fden (calcFunc-factors den var)) 995 (let* ((fden (calcFunc-factors den var))
990 (tdeg (math-polynomial-p den var)) 996 (tdeg (math-polynomial-p den var))
991 (fp fden) 997 (fp fden)
992 (dlist nil) 998 (dlist nil)
993 (eqns 0) 999 (eqns 0)