This forum has been archived. All content is frozen. Please use KDE Discuss instead.

Solving sparse problem with same pattern

Tags: None
(comma "," separated)
dariog
Registered Member
Posts
2
Karma
0
First of all, i want to thank all developers for this *great* library.

I have a question about solving sparse matrix problems with the same pattern. Here is my scenario:

I build a Sparse Matrix A using a vector<Triplet>. Those triplets may have multiple entries (i.e. values with same indexes which have to be summed) and eventually two entries may be opposite (i.e. they result in an exact zero). Then i have to solve Ax=b.

I succesfully solve the problem using the compute() + .solve() function of the library. However i have to do further iterations with the original matrix A, and I'm planning to use the method .analyzePattern() + .factorize() + .solve()

The actual algorithm is

- Build matrix A and a NonSparse vector b
- Solve Ax=b
- Analyze results
- Rebuild a new A and b
- Loop until required

When rebuilding A, the same pattern is used: I change values but not indexes of triplets. However if in the previous steps i have some opposite values which lead to a zero, this may not happen in the current iteration.

My question is:
does two opposite entries in a sparse matrix leads to an explicit insertion of the 0-value in the pattern? Are those zero entries considered in the anlyzePattern() method?

Thanks
Dario
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
the explicit zeros are preserved, so that's good for you.
dariog
Registered Member
Posts
2
Karma
0
Wow! Another boost of speed!

Thanks for your reply.

Dario


Bookmarks



Who is online

Registered users: Bing [Bot], Google [Bot], Yahoo [Bot]