Suppose i have matrix of size 1000*1000 with 70% sparsity. I am performing some multiplication, inverse operations upon it. While making calculations, does MATLAB make checks to see if matrix is sparse and perform operations accordingly(like ignoring multiplications if one of elements is zero) or do we need to explicitly mention it. What are possible ways to do so.
Suppose I have sparse matrix A. I want to get inverse of it. Usually I will use function inv(A)
. Since matrix is sparse, I might use following operations
sparse_A = sparse(A); inv_sparse_A = inv(sparse_A); inv_A = full(inv_sparse_A);