Eigen on ARM Cortex M3 with armcc

纵饮孤独 提交于 2019-12-08 04:13:46

问题


I'm trying to use Eigen library with armcc compiler using Keil for Cortex M3 target and I get compilation error:

Eigen/src/Core/Transpositions.h(387): error:  #135: class template "Eigen::Transpose<Eigen::TranspositionsBase<Derived>>" has no member "derived"

It comes from this code:

class Transpose<TranspositionsBase<TranspositionsDerived> >
{
    typedef TranspositionsDerived TranspositionType;
    typedef typename TranspositionType::IndicesType IndicesType;
  public:

    explicit Transpose(const TranspositionType& t) : m_transpositions(t) {}

    Index size() const { return m_transpositions.size(); }
    Index rows() const { return m_transpositions.size(); }
    Index cols() const { return m_transpositions.size(); }

    /** \returns the \a matrix with the inverse transpositions applied to the columns.
      */
    template<typename OtherDerived> friend
    const Product<OtherDerived, Transpose, AliasFreeProduct>
    operator*(const MatrixBase<OtherDerived>& matrix, const Transpose& trt)
    {
      // !!!!!!! this line triggers the error
      return Product<OtherDerived, Transpose, AliasFreeProduct>(matrix.derived(), trt.derived()); 
    }

    /** \returns the \a matrix with the inverse transpositions applied to the rows.
      */
    template<typename OtherDerived>
    const Product<Transpose, OtherDerived, AliasFreeProduct>
    operator*(const MatrixBase<OtherDerived>& matrix) const
    {
      return Product<Transpose, OtherDerived, AliasFreeProduct>(*this, matrix.derived()); 
    }

    const TranspositionType& nestedExpression() const { return m_transpositions; }

  protected:
    const TranspositionType& m_transpositions;
};

I'm not very good with template magic so I'm interested how it's supposed to work.

I don't see any methods called derived in Transpose class, it doesn't inherit from any other class. The only method with that name is in class TranspositionsBase which is passed in Transpose as a template parameter and as far as I can see, is not used.

Can somebody please explain me what is going on here? And, if it's possible, why there is a compilation error?

来源:https://stackoverflow.com/questions/42110544/eigen-on-arm-cortex-m3-with-armcc

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!