R/determinants.R
rowCofactors.Rd
Returns the vector of cofactors of row i of the square matrix A. The determinant, Det(A), can then be found as M[i,] %*% rowCofactors(M,i) for any row, i.
Det(A)
M[i,] %*% rowCofactors(M,i)
rowCofactors(A, i)
a square matrix
row index
a vector of the cofactors of A[i,]
Det for the determinant
Det
Other determinants: Det(), adjoint(), cofactor(), minor(), rowMinors()
Det()
adjoint()
cofactor()
minor()
rowMinors()
Michael Friendly
M <- matrix(c(4, -12, -4, 2, 1, 3, -1, -3, 2), 3, 3, byrow=TRUE) minor(M, 1, 1) #> [1] 11 minor(M, 1, 2) #> [1] 7 minor(M, 1, 3) #> [1] -5 rowCofactors(M, 1) #> [1] 11 -7 -5 Det(M) #> [1] 148 # expansion by cofactors of row 1 M[1,] %*% rowCofactors(M,1) #> [,1] #> [1,] 148