Reputation: 207
I have a very large square matrix of order around 100000 and I want to know whether the determinant value is zero or not for that matrix.
What can be the fastest way to know that ?
I have to implement that in C++
Upvotes: 1
Views: 1297
Reputation: 25972
Usually, matrices of that size are extremely sparse. Use row and column reordering algorithms to concentrate the entries near the diagonal and then use a QR decomposition or LU decomposition. The product of the diagonal entries of the second factor is - up to a sign in the QR case - the determinant. This may still be too ill-conditioned, the best result for rank is obtained by performing a singular value decomposition. However, SVD is more expensive.
Upvotes: 1
Reputation: 6246
From my knowledge your application doesnt need to calculate determinant but the rank of matrix is sufficient to check if system of equations have non-trivial solution : -
Upvotes: 0
Reputation: 1132
Assuming you are trying to determine if the matrix is non-singular you may want to look here:
As mentioned in the comments its best to use some sort of BLAS library that will do this for you such as Boost::uBLAS
.
Upvotes: 1
Reputation: 1493
There is a property that if any two rows are equal or one row is a constant multiple of another row we can say that determinant of that matrix is zero.It is applicable to columns as well.
Upvotes: 0