public double permutationDeterminant ( ) { int sign = 1 ; double sum = 0 ; PermutationMatrix pm = PermutationMatrix . getInstance ( rows ) ; int perms = pm . rows ; for ( int p = 0 ; p < perms ; p ++ ) { double mul = 1 ; for ( int i = 0 ; i < rows ; i ++ ) { mul *= get ( i , pm . get ( p , i ) ) ; } sum += sign * mul ; sign = - sign ; } return sum ; }
Calculates determinant by using permutations