草庐IT

SparseVector

全部标签

c++ - 如何在 Eigen 中初始化 SparseVector

如何在Eigen中初始化一个SparseVector?以下代码:#defineEIGEN_YES_I_KNOW_SPARSE_MODULE_IS_NOT_STABLE_YET#includeusingnamespaceEigen;SparseVectorvec(3);main(){vec(0)=1.0;}给我以下错误error:callofanobjectofaclasstypewithoutappropriateoperator()orconversionfunctionstopointer-to-functiontypevec(0)=1.0;顺便说一下,vec[0]=1.0也不起作