Artifact b9aa1edb9f0e2f64137cfd1adb3cd1cf3bbde8ee1df79fb7a40f82822e04569a:
- Executable file
r37/packages/matrix/cofactor.red
— part of check-in
[f2fda60abd]
at
2011-09-02 18:13:33
on branch master
— Some historical releases purely for archival purposes
git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/trunk/historical@1375 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 1066) [annotate] [blame] [check-ins using] [more...]
- Executable file
r38/packages/matrix/cofactor.red
— part of check-in
[f2fda60abd]
at
2011-09-02 18:13:33
on branch master
— Some historical releases purely for archival purposes
git-svn-id: https://svn.code.sf.net/p/reduce-algebra/code/trunk/historical@1375 2bfe0521-f11c-4a00-b80e-6202646ff360 (user: arthurcnorman@users.sourceforge.net, size: 1066) [annotate] [blame] [check-ins using]
module cofactor; % Cofactor operator. % Author: Alan Barnes <barnesa@kirk.aston.ac.uk>. comment Syntax: COFACTOR(MATRIX:matrix,ROW:integer,COLUMN:integer):algebraic The cofactor of the element in row ROW and column COLUMN of matrix MATRIX is returned. Errors occur if ROW or COLUMN do not simplify to integer expressions or if MATRIX is not square; symbolic procedure cofactorq (u,i,j); begin integer len; len:= length u; if not(i>0 and i<len+1) then rerror(matrix,20,"Row number out of range"); if not(j>0 and j<len+1) then rerror(matrix,21,"Column number out of range"); foreach x in u do if length x neq len then rerror(matrix,22,"non-square matrix"); u := remove(u,i); clrhash(); u := detq1(u,len-1,2**(j-1)); clrhash(); if remainder(i+j,2)=1 then u := negsq u; return u; end; put ('cofactor,'simpfn,'simpcofactor); symbolic procedure simpcofactor u; cofactorq(matsm car u,ieval cadr u,ieval carx(cddr u,'cofactor)); endmodule; end;