Reputation: 2347
I want to know how MATLAB does memory management for the following system of equations that includes indexing of the sparse matrix.
x = A(indices,indices) \ b(indices);
A
is a sparse symmetric matrix, b
is a column-vector, indices
has the index of the elements of A
to be included in the system of equations Ax = b
.
I think A
is stored as a CSC
(compressed sparse column). It is then stored temporarily in the memory with a different CSC
data. The new CSC
is finally used in the system of equations with b(indices)
, similar to the following:
Aindexed = A(indices,indices); % New symmetric sparse matrix
bindexed = b(indices);
x = Aindexed \ bindexed;
Does MATLAB have special sparse solvers with matrix indexing? I think it's less likely that MATLAB does the indexing inside the solver and the sparse matrix has to be indexed prior to being used in the solver. These are just my guesses. Could someone kindly shed some light on this subject? Thank you.
Upvotes: 1
Views: 91
Reputation: 71
Sparse linear solvers usually use storage schemes based either on linked lists or on adjacency structures. The first is more flexible, allowing easy inclusion of new elements, compression, etc. The second scheme is economical in terms of RAM requirements, and also provides better performance for the processing algorithms, but inclusion/exclusion of elements is not possible. You can find more information and ask specific questions if you visit the following blog: http://comecau.blogspot.com/2018_09_05_archive.html
Upvotes: 1