Amomum
Amomum

Reputation: 6503

Eigen on ARM Cortex M3 with armcc

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?

Upvotes: 1

Views: 836

Answers (1)

mascoj
mascoj

Reputation: 1329

armcc has limited support for C++ and is not guaranteed to work for template-heavy libraries such as Eigen.

See armcc Supported C++11 Features for more details.

For better C++ support, armclang should be used for maximum compatibility.

Upvotes: 0

Related Questions