c++ - Finding the source of a failed static assertion on Eigen -


i'm trying compile -quite large- code base has dependencies eigen. doing so, got following error: error c2338: the_bracket_operator_is_only_for_vectors__use_the_parenthesis_operator_instead originates here:

//    eigen\src\core\densecoeffsbase.h   /** \returns reference coefficient @ given index.   *   * method allowed vector expressions, , matrix expressions having linearaccessbit.   *   * \sa operator[](index) const, operator()(index,index), x(), y(), z(), w()   */  eigen_strong_inline scalar& operator[](index index) {   #ifndef eigen2_support   eigen_static_assert(derived::isvectoratcompiletime,                       the_bracket_operator_is_only_for_vectors__use_the_parenthesis_operator_instead)   #endif   eigen_assert(index >= 0 && index < size());   return derived().coeffref(index); } 

as eigen dependencies on code, how can find line triggering error? (obviously, there line of code accessing eigen matrix using [], somewhere, line i'm looking for).

yes, encountered similar problem. defined matrix as:

eigen::matrixxf minor2x2 (2,2). when matrix minor2x2 initialized :

minor2x2[0] = 1.0f; minor2x2[1] = 1.0f; minor2x2[2] = 1.0f; minor2x2[3] = 1.0f; 

the same error triggered. solution problem replace minor2x2[i] minor2x2(i). think finding eigen::matrix perhaps helpful.


Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -