det(m)→d
if d≠0 or gettype(d)="EXPR" then
m^(⁻1)*d→n
else
rowdim(m)→k
newmat(k,k)→n
for i,1,k
for j,1,k
(⁻1)^(i+j)*det((mrowdel(mrowdel(m,i),j)))→n[j,i]
endfor
endfor
endif
return n
EndFunc
adjoint() uses equation [2] if the matrix is non-singular, or if the matrix is symbolic. There is no error
checking, and a Dimension error occurs if the matrix is not square.
The process of finding the matrix minor is built into adjoint(), but mminor() returns the minor, if needed:
mminor(m,r,c)
Func
©(m,r,c) Return first minor r,c of matrix m
return det((mrowdel(mrowdel(m,r),c)))
EndFunc
adjoint() and mminor() call mrowdel(), which is described in tip [3.3].
To find the adjoint of
ab
cd
use this call:
adjoint([[a,b][c,d]]
which returns
d −b
−ca
To find the adjoint of
123
134
143
use this call
adjoint([[1,2,3][1,3,4][1,4,3]])
3 - 8