1352
2016-11-30 10:22:31 +0000
Generalize replicate(.) to block diagonal replication
2019-12-04 16:33:04 +0000
1
1
1
Unclassified
Eigen
Core - expression templates
3.3 (current stable)
All
All
NEW
Normal
Feature Request
---
1
Angelos.Mantzaflaris
eigen.nobody
chtz
gael.guennebaud
jacob.benoit.1
oldest_to_newest
6510
0
Angelos.Mantzaflaris
2016-11-30 10:22:31 +0000
The Matrix::replicate(int) is very useful for writing compact formulas.
I am also using (through the plugin mechanism) a similar expression, called blockDiag(int):
Eigen::Matrix A;
Eigen::Matrix B = A.blockDiag(3);
produces the matrix exrpression:
[ A 0 0 ]
[ 0 A 0 ]
[ 0 0 A ]
The implementation is very similar to the replicate. This can be used eg. in the context of elasticity finite element matrices, if A are derivatives of scalar basis functions and the block diagonal expression provides derivatives of (3D) displacement vector.
Maybe a better name could be Matrix::diagonalReplicate(int). Posting it here just in case that it is of interest for other purposes as well.
6515
1
gael.guennebaud
2016-11-30 17:04:00 +0000
This feature would be more powerful with a true concept of block-diagonal for which diagonalReplicate would only be a special case. Otherwise the special structure is lost.
6516
2
Angelos.Mantzaflaris
2016-11-30 17:56:18 +0000
Sure, that would be nice, then something like
std::vector<Eigen::Matrix<double> > mVec(3);
Eigen::BlockDiagonal<double> M(mVec);
or
Eigen::BlockDiagonal<double> M;
M.append(A);
M.append(B);
M.append(C);
to get
[ A 0 0 ]
[ 0 B 0 ]
[ 0 0 C ]
so that
Eigen::BlockDiagonal<double> M(A,3);
yields diagonalReplicate.
9796
3
eigen.nobody
2019-12-04 16:33:04 +0000
-- GitLab Migration Automatic Message --
This bug has been migrated to gitlab.com's GitLab instance and has been closed from further activity.
You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.com/libeigen/eigen/issues/1352.