If s is Bareiss, then the Bareiss algorithm is used; if s is Cofactor, then cofactor expansion is used.
Description
The ring of M determines the default strategy. If the ring is a polynomial ring or a field (as identified by isField) then the Bareiss algorithm is used. If the ring is a quotient ring (which has not been declared a field by toField), then the Cofactor algorithm is used.
The Bareiss algorithm returns a ring element that may differ from the actual determinant by a zero divisor in the ring. Thus, an incorrect answer may be computed if the ring contains zero divisors.