我试图使用Eigen的映射功能来映射到内存中的稀疏向量,但我似乎无法编译声明,因为'InnerStrideAtCompileTime'不是'Eigen::SparseVector<_标量,0,_StorageIndex>'。
这不受支持吗?
示例代码:
#include <Eigen/Core>
#include <Eigen/SparseCore>
void Foo()
{
int innerIndices[10];
float values[10];
Eigen::Map<const Eigen::SparseVector<float>> eigenRigOffsets(100, 10, &innerIndices[0], &values[0]);
}
它似乎(还(不受支持。有对Eigen::Map<Eigen::SparseMatrix<float>>
的支持(如文档中所示(,尽管这不是您所要求的。也许,ggael会有一个更好的答案(或实现(。