## `linalg::adjoint` -- Adjoint of a matrix

#### Introduction

`linalg::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.

#### Call(s)

`linalg::adjoint(A)`

#### Parameters

`A` | - | a square matrix of a domain of category `Cat::Matrix`

#### Returns

a matrix of the same domain type as `A`.

#### Related Functions

`linalg::det`

#### Details

- The component ring of `A` must be of category `Cat::CommutativeRing`.

#### Example 1

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  |
                        +-            -+   +-            -+

#### Background

- The adjoint of a square matrix A is the matrix whose (i,j)-th entry is the (j,i)-th cofactor of A.

  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.

Do you have questions or comments?
Copyright © SciFace Software GmbH & Co. KG 2000