linalg::adjoint
-- Adjoint of a
matrixlinalg::adjoint
(A)
computes the adjoint
Adj(A) of the nxn matrix A. The
adjoint matrix satisfies the equation A*Adj(A) = det(A)*I,
where I is the n x n identity matrix.
linalg::adjoint(A)
A |
- | a square matrix of a domain of category Cat::Matrix |
a matrix of the same domain type as A
.
A
must be of category Cat::CommutativeRing
.We define a matrix over the rationals:
>> MatQ := Dom::Matrix( Dom::Rational ): A := MatQ( [[0, 2, 1], [2, 1, 0], [1, 0, 2]] )
+- -+ | 0, 2, 1 | | | | 2, 1, 0 | | | | 1, 0, 2 | +- -+
Then the adjoint matrix of A
is given
by:
>> Ad := linalg::adjoint(A)
+- -+ | 2, -4, -1 | | | | -4, -1, 2 | | | | -1, 2, -4 | +- -+
We check the property of the adjoint matrix
Ad
mentioned above:
>> A * Ad = linalg::det(A)*MatQ::identity(3)
+- -+ +- -+ | -9, 0, 0 | | -9, 0, 0 | | | | | | 0, -9, 0 | = | 0, -9, 0 | | | | | | 0, 0, -9 | | 0, 0, -9 | +- -+ +- -+
The (j,i)-th cofactor of A is defined by A'[i,j] = (-1)^(i+j)*det(A(i|j)), where A(i|j) is the submatrix of A obtained from A by deleting the i-th row and j-th column.