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

How to define sparsity patterns for optimal code generation?

Tags: None
(comma "," separated)
User avatar
emilf
Registered Member
Posts
29
Karma
0
OS
Hi all,

I have been looking into how I can define sparsity patterns of matrices.
Lets say I have a matrix (matlab-ish syntax)
Code: Select all
A = [I, T;
      0, I]
where I is an NxN identity matrix and T is an NxN dense matrix.
Is it possible to instruct Eigen to not use all the 0s in this matrix?
I am using Eigen on an embedded system, and would need to really remove all operations in the generated code that will access 0 elements.

Thanks!
User avatar
emilf
Registered Member
Posts
29
Karma
0
OS
I have been testing some different approaches, and if I manually write out the block operations I get the expected result.
However, the sparse matrix representation seems only to support row/column vectors, not block/diagonal block-sparsity.

Are there ways to automatically generate, perhaps through customising a matrix type, the block operations?
Give Eigen knowledge about the structure in a dense matrix.

Edit:
For example, how CVXGEN (http://cvxgen.com/) specifies its sparse matrices is quite intuitive and generates the minimal set of memory and operations needed.
Though I do not think it can be lifted like that into C++, it shows the usage case quite well.


Bookmarks



Who is online

Registered users: abc72656, Bing [Bot], daret, Google [Bot], Sogou [Bot], Yahoo [Bot]