Mercurial > emacs
comparison lisp/calc/calc-ext.el @ 66478:57b78015fb51
Add functions to autoloads.
(math-identity-matrix-p, math-ident-row-p): New functions.
author | Jay Belanger <jay.p.belanger@gmail.com> |
---|---|
date | Fri, 28 Oct 2005 03:51:00 +0000 |
parents | 1db49616ce05 |
children | 22f581f4fe39 |
comparison
equal
deleted
inserted
replaced
66477:117f8e71b37a | 66478:57b78015fb51 |
---|---|
657 '( | 657 '( |
658 | 658 |
659 ("calc-alg" calc-has-rules math-defsimplify | 659 ("calc-alg" calc-has-rules math-defsimplify |
660 calc-modify-simplify-mode calcFunc-collect calcFunc-esimplify | 660 calc-modify-simplify-mode calcFunc-collect calcFunc-esimplify |
661 calcFunc-islin calcFunc-islinnt calcFunc-lin calcFunc-linnt | 661 calcFunc-islin calcFunc-islinnt calcFunc-lin calcFunc-linnt |
662 calcFunc-simplify calcFunc-subst math-beforep | 662 calcFunc-simplify calcFunc-subst calcFunc-writeoutpower math-beforep |
663 math-build-polynomial-expr math-expand-formula math-expr-contains | 663 math-build-polynomial-expr math-expand-formula math-expr-contains |
664 math-expr-contains-count math-expr-depends math-expr-height | 664 math-expr-contains-count math-expr-depends math-expr-height |
665 math-expr-subst math-expr-weight math-integer-plus math-is-linear | 665 math-expr-subst math-expr-weight math-integer-plus math-is-linear |
666 math-is-multiple math-is-polynomial math-linear-in math-multiple-of | 666 math-is-multiple math-is-polynomial math-linear-in math-multiple-of |
667 math-poly-depends math-poly-mix math-poly-mul | 667 math-poly-depends math-poly-mix math-poly-mul |
921 '( | 921 '( |
922 | 922 |
923 ("calc-alg" calc-alg-evaluate calc-apart calc-collect calc-expand | 923 ("calc-alg" calc-alg-evaluate calc-apart calc-collect calc-expand |
924 calc-expand-formula calc-factor calc-normalize-rat calc-poly-div | 924 calc-expand-formula calc-factor calc-normalize-rat calc-poly-div |
925 calc-poly-div-rem calc-poly-gcd calc-poly-rem calc-simplify | 925 calc-poly-div-rem calc-poly-gcd calc-poly-rem calc-simplify |
926 calc-simplify-extended calc-substitute) | 926 calc-simplify-extended calc-substitute calc-writeoutpower) |
927 | 927 |
928 ("calcalg2" calc-alt-summation calc-derivative | 928 ("calcalg2" calc-alt-summation calc-derivative |
929 calc-dump-integral-cache calc-integral calc-num-integral | 929 calc-dump-integral-cache calc-integral calc-num-integral |
930 calc-poly-roots calc-product calc-solve-for calc-summation | 930 calc-poly-roots calc-product calc-solve-for calc-summation |
931 calc-tabulate calc-taylor) | 931 calc-tabulate calc-taylor) |
2104 ;;; True if A is a square matrix. [P V] [Public] | 2104 ;;; True if A is a square matrix. [P V] [Public] |
2105 (defun math-square-matrixp (a) | 2105 (defun math-square-matrixp (a) |
2106 (let ((dims (math-mat-dimens a))) | 2106 (let ((dims (math-mat-dimens a))) |
2107 (and (cdr dims) | 2107 (and (cdr dims) |
2108 (= (car dims) (nth 1 dims))))) | 2108 (= (car dims) (nth 1 dims))))) |
2109 | |
2110 ;;; True if MAT is an identity matrix. | |
2111 (defun math-identity-matrix-p (mat &optional mul) | |
2112 (if (math-square-matrixp mat) | |
2113 (let ((a (if mul | |
2114 (nth 1 (nth 1 mat)) | |
2115 1)) | |
2116 (n (1- (length mat))) | |
2117 (i 1)) | |
2118 (while (and (<= i n) | |
2119 (math-ident-row-p (nth i mat) i a)) | |
2120 (setq i (1+ i))) | |
2121 (if (> i n) | |
2122 a | |
2123 nil)))) | |
2124 | |
2125 (defun math-ident-row-p (row n &optional a) | |
2126 (unless a | |
2127 (setq a 1)) | |
2128 (and | |
2129 (not (memq nil (mapcar | |
2130 (lambda (x) (eq x 0)) | |
2131 (nthcdr (1+ n) row)))) | |
2132 (not (memq nil (mapcar | |
2133 (lambda (x) (eq x 0)) | |
2134 (butlast | |
2135 (cdr row) | |
2136 (- (length row) n))))) | |
2137 (eq (elt row n) a))) | |
2109 | 2138 |
2110 ;;; True if A is any scalar data object. [P x] | 2139 ;;; True if A is any scalar data object. [P x] |
2111 (defun math-objectp (a) ; [Public] | 2140 (defun math-objectp (a) ; [Public] |
2112 (or (integerp a) | 2141 (or (integerp a) |
2113 (memq (car-safe a) '(bigpos bigneg frac float cplx | 2142 (memq (car-safe a) '(bigpos bigneg frac float cplx |