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

Sparse Matrix product and symmetric matrix

Tags: None
(comma "," separated)
Akkawe
Registered Member
Posts
35
Karma
0
OS
Hello, I am no sure about these two issues:

1) I have a symmetric sparse matrix (double) M in which I store only the upper part and a non symmetric sparse matrix (double) T ;
Is T.transpose()*M.selfadjointView<Upper>()*T correct ?

2) In the case of complex matrix, to use selfadjointView<Symmetrix > in place of selfadjointView<Upper> is equivalent to force:

mij = mji = a+ib ?

Thx
User avatar
ggael
Moderator
Posts
3447
Karma
19
OS
1) T.transpose()*M.selfadjointView<Upper>()*T probably does not work yet. You have to evaluate M.selfadjointView<Upper>() into a full SparseMatrix:

SparseMatrix<double> tmp;
tmp = M.selfadjointView<Upper>();
T.transpose()*tmp*T


2) selfadjointView<...> only accepts Upper or Lower. In the future, symmetricView<Upper or Lower> will provide what you're looking for.
Akkawe
Registered Member
Posts
35
Karma
0
OS
ggael wrote:1) T.transpose()*M.selfadjointView<Upper>()*T probably does not work yet. You have to evaluate M.selfadjointView<Upper>() into a full SparseMatrix:

SparseMatrix<double> tmp;
tmp = M.selfadjointView<Upper>();
T.transpose()*tmp*T


2) selfadjointView<...> only accepts Upper or Lower. In the future, symmetricView<Upper or Lower> will provide what you're looking for.


tnx


Bookmarks



Who is online

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