This function calculates the adjoint of a square matrix, defined as the transposed matrix of cofactors of all elements.

adjoint(A)

Arguments

A

a square matrix

Value

a matrix of the same size as A

See also

Other determinants: Det(), cofactor(), minor(), rowCofactors(), rowMinors()

Author

Michael Friendly

Examples

A <- J(3, 3) + 2*diag(3)
adjoint(A)
#>      [,1] [,2] [,3]
#> [1,]    8   -2   -2
#> [2,]   -2    8   -2
#> [3,]   -2   -2    8