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

[SOLVED] How to erase zero elements from sparse objects?

Tags: None
(comma "," separated)
Seb
Registered Member
Posts
99
Karma
0
Hi Gael,

today I tried to remove elements which are close to zero from a DynamicSparseMatrix object. I can set the appropriate elements to exact zero, but they are not removed from the containers. (the number returned by numZeros stays the same) This technique is used to save computing time during operations and a lot of memory due to round-offs. Is there anything that I have overseen?

Thanks

Last edited by ggael on Tue Feb 03, 2009 9:10 am, edited 1 time in total.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
Seb wrote:Hi Gael,

today I tried to remove elements which are close to zero from a DynamicSparseMatrix object. I can set the appropriate elements to exact zero, but they are not removed from the containers. (the number returned by numZeros stays the same) This technique is used to save computing time during operations and a lot of memory due to round-offs. Is there anything that I have overseen?

Thanks


this is on the TODO list... this will be available for both sparse matrix types.
Seb
Registered Member
Posts
99
Karma
0
I see. Thanks for pointing this out. - and please give you some time - it does not urge this time ;)
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
Seb wrote:I see. Thanks for pointing this out. - and please give you some time - it does not urge this time ;)


mat.prune(reference_value, epsilon);

will remove all coeff such that: coeff ()


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot], rblackwell