Reputation: 11
What is the fastest way to check whether a system of linear equations has a solution?
All numbers are rational numbers and the (large) coefficient matrix can be given in the form of SparseArray.
I know that LinearSolve can solve this problem, but if you don't need to know what the solution is, but only need to judge the existence, is there a more efficient method?
The way to calculate rank seems to be slower when there is no solution.
By the way, when I use 'LinearSolve', the form of 'SparseArray' can't help me get faster, even if there are only very limited non-zero elements in each row.
Upvotes: 1
Views: 113
Reputation: 14637
One idea is verifying
Det[PseudoInverse[m]] == 0.
where m
is the square matrix of the coefficients.
Upvotes: 0