如何初始化特征中的SparseVector?以下代码:如何初始化特征中的SparseVector
#define EIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET
#include <Eigen/Sparse>
using namespace Eigen;
SparseVector<float> vec(3);
main()
{
vec(0)=1.0;
}
的方式给我以下错误
error: call of an object of a class type without appropriate operator() or conversion functions to pointer-to-function type vec(0)=1.0;
,VEC [0] = 1.0也不起作用。
从来没有听说过Eigen,但粗略看一下我注意到'coeffRef'的文档,你试过'vec.coeffRef(0)= 1.0'吗? – HostileFork
非常感谢。这实际上是在SparseVector中插入的方式。 – Tarek
好吧,我会这样回答... – HostileFork