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

Optimise a chain matrix mul with special structure

Tags: None
(comma "," separated)
wingsit
Registered Member
Posts
28
Karma
0
OS
is it possible to do this in Eigen so it can be faster than calling GEMM in MKL

R.transpose() * C * R

where

R = triangular matrix (n, n)
C = symmetric matrix (n, n)
n = dynamic unsigned int in the range of [1000, 10000]

i tried something aloong R.tranpose().triangularView<Upper>() * C.selfadjointView(Upper) * R.triangularView<Lower>() but i have been facing compilation error. What is the way to express this operation in Eigen? What if we also make the assumption that R is sparse and C is dense?

Thanks.
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
Currently the best you can do is the following:

tmp = R.transpose().triangularView<Upper>() * C;
result = tmp * R.triangularView<Lower>();

In the future, you should be able to exploit the fact that result is symmetric. Currently that's only possible is both factors are dense (not triangular).

If R is very sparse, like ~10 non zeros per row, then you can use a SparseMatrix.


Bookmarks



Who is online

Registered users: Baidu [Spider], Bing [Bot], Google [Bot], rblackwell