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

Matrix Types

Tags: None
(comma "," separated)
ibaran
Registered Member
Posts
1
Karma
0

Matrix Types

Fri Feb 06, 2009 8:24 pm
Hello,

I've played a bit with Eigen and I'm very impressed. I've been rolling my own for small matrices and wrapping MKL for large ones and Eigen appears to beat both approaches hands down. My only complaint is that the aligned fixed-size matrices are not POD (leading to hacks like Eigen/StdVector)--and I don't think there's a good solution to this in C++ (but easy access to non-vectorized fixed size objects in code that uses vectorized dynamic size objects would be good).

I was thinking about whether it is possible to orthogonally and generically deal with different matrix types. What I mean is that different matrices require specialized algorithms and possibly different storage schemes, and are closed under different operations. For example, here's a list of the first types that come to mind (with closure properties):

Symmetric/Hermitian (+,*,T) possibly triangular storage
Skew Symmetric/Hermitian -- ditto
Symmetric positive (semi)definite (+,*,T but not closed under -), subtype of symmetric
Banded (+, *, T) parameterized by bandwidth--fixed or Dynamic; band storage
Upper triangular (+,*) possibly triangular storage, possibly subtype of banded
Lower triangular -- ditto
Hessenberg (+) upper and lower, also possibly subtype of banded
Diagonal (+,*,T), subtype of banded, symmetric
Orthogonal/Unitary (*,T)
Permutation (*,T) subtype of orthogonal, special storage
Toeplitz (+,T) special storage
User-defined
Sparse (+,T) special storage

Above, by subtype, I mean "mathematical", not C++ subclass. I am wondering if there's a flags and traits or some other metaprogramming method that will make working with all of these simple and transparent--and fall back to default dense algorithms when a specialized one is not available (i.e. product of a permutation matrix and another matrix is specialized, but product of a triangular matrix and a general matrix may not be). I realize that Eigen already does some of this, but I think a systematic way of dealing with different matrix types would be great and simplify internal algorithms (e.g. storing permutations as matrices and working with them as such--or making a special Householder matrix type). I also realize that this is not an easy problem--the C++ type system is not ideally suited for this type of thing.

I imagine the Eigen developers have already thought about some of this--I wanted to see what the thoughts are.

Thanks,

-Ilya
User avatar
bjacob
Registered Member
Posts
658
Karma
3

RE: Matrix Types

Fri Feb 06, 2009 8:43 pm
Indeed this is a currently hot discussion topic on the mailing list (which is where we centralize all the development discussion, the forum being intended only for user support).

You can see the archives and/or subscribe:
http://eigen.tuxfamily.org/index.php?ti ... iling_list


Join us on Eigen's IRC channel: #eigen on irc.freenode.net
Have a serious interest in Eigen? Then join the mailing list!
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS

RE: Matrix Types

Fri Feb 06, 2009 8:59 pm
Hi,

about non vectorized fixed size matrix you can do:
Matrix

About the support of multiple matrix type, indeed this is not an easy problem and we are currently thinking about that for 2.1. There are some preliminary thoughts here:
http://eigen.tuxfamily.org/index.php?ti ... cialMatrix
feel free to edit the page to add your ideas/comments if any !


Bookmarks



Who is online

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