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

Logical sparse matrices

Tags: None
(comma "," separated)
ErlendA
Registered Member
Posts
12
Karma
0
OS

Logical sparse matrices

Thu Aug 04, 2011 11:38 am
Are there any plans on implementing logical sparse matrices in Eigen? I.e. a matrix type where all nonzero entries are implicitly assumed to be one, the value-array is not stored.

For some applications, the power graph of the adjacency matrix are required, and storing the value-array leads to memory bloating and also performance degradation.
johnm1019
Registered Member
Posts
46
Karma
0

Re: Logical sparse matrices

Fri Aug 12, 2011 9:57 am
Can't you use a boolean sparse with negative logic?
ErlendA
Registered Member
Posts
12
Karma
0
OS

Re: Logical sparse matrices

Fri Aug 12, 2011 10:48 am
What would negative logic entail?

If I use a boolean sparse, I believe the array of values are still stored. Additionally, I suspect that internal calculation use the usual rules for addition and multiplication, which are not needed. Please tell me if I am wrong.
johnm1019
Registered Member
Posts
46
Karma
0

Re: Logical sparse matrices

Fri Aug 12, 2011 1:24 pm
Ah, I see your optimization -- nixing the value matrix. Either way, booleans are only 1 extra bit. I suppose you should just look at the overhead of the sparse indecies+1 bit vs. a dense for your matrix size and sparsity factors.

As for negative logic, that just assumes 0 == true and 1 == false, so the current paradigm of anything not stored == 0 gives you the logic you want.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

Re: Logical sparse matrices

Fri Aug 12, 2011 8:46 pm
Yes I've already thought about adding such a feature. I'd probably go for extending the Options template parameter of SparseMatrix<>.


Bookmarks



Who is online

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