![]() Registered Member ![]()
|
I've to perform an element wise addition on sparse matrices.
Is there equal to dense matrices a way like the conversion with arrays? I think one way is to do this by iterators? I can ensure that the matrices have the same dimensions thus iterating over on and implicit parsing the second one should be an option, is it? Is is possible to use cwise() for an addition? Like sparseMat1.cwise() += sparseMat2; ![]() The result should be equivalent to Matlabs .+ operator. Does anybody have a hint? Best Martin |
![]() Moderator ![]()
|
The addition of two matrix is always defined to be element-wise, so you can do: sparseMat1 = sparseMat1 + sparseMat2;
|
![]() Registered Member ![]()
|
Thanks for the expatiation.
![]() My matrices are big and contain a big amount of non-zero entries, hence consume a big amount of memory. ![]() After computing the individual matrices the results were stored by using Market format. The marked files contain up to 22 000 000 000 entries (non zero elements). It showed up that sometimes it's impossible to store two complete matrices at the same time in memory. Thus I was looking for an option to add either the second matrix "on the fly" to the first (maybe element wise) or to perform a segmented addition. Is there a routine available for performing this? |
![]() Moderator ![]()
|
Then you need to by larger memory module
![]() |
Registered users: Bing [Bot], claydoh, Google [Bot], rblackwell, Yahoo [Bot]