【发布时间】:2021-09-17 06:56:07
【问题描述】:
我想将矩阵 (3x3) 的上三角部分提取为向量。
在带有 numpy 的 python 中,我可以执行以下操作:
myMat = myMat[np.triu_indices(3)]
cpp 中是否有与 Eigen 等价的东西?
【问题讨论】:
我想将矩阵 (3x3) 的上三角部分提取为向量。
在带有 numpy 的 python 中,我可以执行以下操作:
myMat = myMat[np.triu_indices(3)]
cpp 中是否有与 Eigen 等价的东西?
【问题讨论】:
刚刚找到了 Eigen 等效项:
myMat.topRightCorner(3,3)
【讨论】:
topRightCorner 返回右上角的块,而不是上三角矩阵。