;ELC ;;; Compiled ;;; in Emacs version 27.1 ;;; with all optimizations. ;;; This file uses dynamic docstrings, first added in Emacs 19.29. ;;; This file does not contain utf-8 non-ASCII characters, ;;; and so can be loaded in Emacs versions earlier than 23. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (byte-code "\300\301!\210\300\302!\207" [require calc-ext calc-macs] 2) (defalias 'calc-mdet #[(arg) "\300\301`\"\207" [calc-do #[nil "\301\302\303#\207" [arg calc-unary-op "mdet" calcFunc-det] 4]] 3 nil "P"]) (defalias 'calc-mtrace #[(arg) "\300\301`\"\207" [calc-do #[nil "\301\302\303#\207" [arg calc-unary-op "mtr" calcFunc-tr] 4]] 3 nil "P"]) (defalias 'calc-mlud #[(arg) "\300\301`\"\207" [calc-do #[nil "\301\302\303#\207" [arg calc-unary-op "mlud" calcFunc-lud] 4]] 3 nil "P"]) (defalias 'math-row-matrix #[(a) "\211\242\301=\262\203\302!\204\301D\207\207" [a vec math-matrixp] 3]) (defalias 'math-col-matrix #[(a) "\211\242\301=\262\203\302!\204\301\303\304A\"B\207\207" [a vec math-matrixp mapcar #[(x) "\301D\207" [x vec] 2]] 4]) (defalias 'math-mul-mats #[(a b) "\306A@G\306\211\211\211\211 \f A\211 \203f \306\fS\211\307V\203[ @AA\310 @\f\n@8\" A\nA\211\203T\311 \310 @\f\n@8\"\"\202; B\202!\312 B\fB\f\202\312\f\237.B\207" [b accum bp ap col row nil 0 math-mul math-add vec cols mat a] 7]) (defalias 'math-mul-mat-vec #[(a b) "\301\302\303A\"B\207" [a vec mapcar #[(row) "\302 \"\207" [row b math-dot-product] 3]] 4]) (defalias 'calcFunc-tr #[(mat) "\301!\203\302\303GS\211A@A@$\207\304\305\"\207" [mat math-square-matrixp math-matrix-trace-step 2 math-reject-arg square-matrixp] 5]) (defalias 'math-matrix-trace-step #[(n size mat sum) " X\203\304T \n\305 \211\n88\"$\207 \207" [n size mat sum math-matrix-trace-step math-add] 9]) (defalias 'math-matrix-inv-raw #[(m) "GS\211\304X\203E\305!\306\n!?\205A\307 \310U\203 \310\202? \311U\203G\312\211\311\21188\313\311A@8!E\312\313\3118A@!A@A@EE\202? \304U\205?\312\211\314\315\304\21188\311\21188\"\315\304\31188\311\30488\"\"\314\315\304A@8\311\30488\"\315\304\21188\311A@8\"\"\314\315\304\31188\311A@8\"\315\304A@8\311\21188\"\"F\312\314\315\304\31188\3048A@\"\315\304\21188\3118A@\"\"\314\315\304\21188A@A@\"\315\304A@8\3048A@\"\"\314\315\304A@8\3118A@\"\315\304\31188A@A@\"\"F\312\314\315\311\30488\3118A@\"\315\311\21188\3048A@\"\"\314\315\311A@8\3048A@\"\315\311\30488A@A@\"\"\314\315\311\21188A@A@\"\315\311A@8\3118A@\"\"FF\n\")\202U\316!\211\205T\317 \320\310 \"\"))\207" [m n det lud 3 math-det-raw math-zerop math-div 1 2 vec math-neg math-sub math-mul math-matrix-lud math-lud-solve calcFunc-idn] 14]) (defalias 'calcFunc-det #[(m) "\302!\203\303 \304\\\305!)!\207\242\306=\203-\307A@!\204)\310A@\311\"\203-A@\207\312\313\"\207" [m calc-internal-prec math-square-matrixp math-normalize 2 math-det-raw calcFunc-idn math-zerop math-equal-int 1 math-reject-arg square-matrixp] 3]) (defalias 'math-det-raw #[(m) "GS\211\304U\203A@A@\202\321 \305U\2035\306\307A@A@\305\21188\"\307\305A@8\3058A@\"\"\202\321 \310U\203\272\306\211\211\311\211\307A@A@\307\305\21188\310\21188\"\"\307\305A@8\307\310\30588\3108A@\"\"\"\307\310A@8\307\3058A@\305\31088\"\"\"\307\310A@8\307\305\21188\3108A@\"\"\"\307A@A@\307\310\30588\305\31088\"\"\"\307\305A@8\307\3058A@\310\21188\"\"\"\202\321\312!\211\203\317\n@\313 \305\n8\")\202\320\314))\207" [m n lud math-det-lu 1 2 math-sub math-mul 3 math-add math-matrix-lud math-det-step 0] 13]) (defalias 'math-det-step #[(n prod) "\303V\203\304S\305 \211\n88\"\"\207 \207" [n prod math-det-lu 0 math-det-step math-mul] 7]) (defvar math-lud-cache nil) (defalias 'math-matrix-lud #[(m) "\306 \"\n D\211\203 A@\f\232\203 AA\202A\3072#\310!0 \f B\n \2037 \n\241\210\202>\nB B **\207" [m math-lud-cache calc-internal-prec calc-prefer-frac context old assoc singular math-do-matrix-lud lud entry] 4]) #@90 Determine a useful value for checking the size of potential pivots in LUD decomposition. (defalias 'math-lud-pivot-check #[(a) "\242\301=\203(\302A@!\203&\302\3038!\203&\304A@\3038\"\305=\203&\305\207\306\207\307!\207" [a mod math-integerp 2 math-gcd 1 0 math-abs-approx] 4 (#$ . 4098)]) (defalias 'math-do-matrix-lud #[(m) "\306!\211GS\307\310\307\211\307\211\310\307\f\nX\203:\310\311\f \fW\203y\312=\203A\313\314\315\316\f #\"\210\f 88\310\211 W\203i\317\320 88\f 88\"\" T\211\202K\f 8\233\240\210 T\211\202, \nX\203\344\312=\203\217\313\314\315\316\f #\"\210\f 88\310\211\fW\203\267\317\320 88\f 88\"\" T\211\202\231\f 8\233\240\210\321!\322\"\323U\266\202\203\334 ) T\211\202z\fV\203\367\324 \f#[B\f\211 88 \325 !\203\326\327\307\"\210\2022\f T\211\nX\2032\f 8\233\330\f 88 \"\240\210\202)\fT\211\202 \237E.\n\207" [m lu n i j k math-copy-matrix nil 1 0 lots math-do-working "LUD step" format "%d/%d" math-sub math-mul math-lud-pivot-check math-compare -1 math-swap-rows math-zerop throw singular math-div imax sum big d index calc-display-working-message dum pivot] 8]) (defalias 'math-swap-rows #[(m r1 r2) " U\2040S\n\233\211A S\n\233\211A\211A \f\241\210 \241\210\fA\241\210\f\241\210-\n\207" [r1 r2 m r1prev row1 r2prev row2 r2next] 3]) (defalias 'math-lud-solve #[(lud b &optional need) "\203#\306 !\211GS\nA@GS@\307\310\211\310\211\310\211\fX\203\311=\203>\312\313\"\210\307\310A@ X\203\304@A\n88\n8\233\n88\240\210\204\206\314!\204\260\202\260\211W\203\260\315\316 88\n88\"\"T\211\202\213\n8\233\240\210T\211\202KS\211\307Y\203\n88T\211 X\203\315\316 88\n88\"\"\202\334\n8\233\317\211 88\"\240\210\202\304T\211\202,\n. \207\205-\320\321\"\207" [lud b x n m lu math-copy-matrix 1 nil lots math-do-working "LUD solver step" math-zerop math-sub math-mul math-div math-reject-arg "*Singular matrix" col i j ip ii index sum calc-display-working-message need] 8]) (defalias 'calcFunc-lud #[(m) "\306!\203\266\307 \310\\\311!\211\205\254\312\n@!\312\n@!\n@GS\313\314 \"\315\314\211 X\203{\314\211W\203Q 8\233\316\240\210T\211\2028\211 8\233\314\240\210T\211 X\203r\f8\233\316\240\210\202ZT\211\202/S\211\314Y\203\244S\nA@8\211U\204\240\317#)\202{\320 \fF.*!\206\272\321\322\"\207\321\323\"\207" [m calc-internal-prec lud lmat umat n math-square-matrixp math-normalize 2 math-matrix-lud math-copy-matrix calcFunc-idn 1 nil 0 math-swap-rows vec math-reject-arg "*Singular matrix" square-matrixp perm i j pos] 6]) (provide 'calc-mtx)