[eigen] matrix function / exponential warnings

[ Thread Index | Date Index | More lists.tuxfamily.org/eigen Archives ]


Hi,

we have a few tiny warnings left in the matrix module. They are
related to the following two functions:

MatrixFunction.h

template <typename ResultType>
inline void evalTo(ResultType& result) const
{
  const typename ei_eval<Derived>::type Aevaluated = m_A.eval();
  MatrixFunction<typename Derived::PlainObject> mf(Aevaluated, m_f);
  mf.compute(result);
}

and to

MatrixExponential.h

template <typename ResultType>
inline void evalTo(ResultType& result) const
{
  const typename ei_eval<Derived>::type srcEvaluated = m_src.eval();
  MatrixExponential<typename Derived::PlainObject> me(srcEvaluated);
  me.compute(result);
}

The issue is that the classes MatrixFunction and MatrixExponential are storing

const MatrixType& m_M;

and it seems to be expected that the MatrixType is always a
PlainObject. I am not sure whether that is really necessary. We
already have a solution to this in Eigen which means storing objects
as ei_nested<...>::type.

Even when we leave the code as is, I think we need to change at least

const typename ei_eval<Derived>::type srcEvaluated = m_src.eval();

to

const typename Derived::PlainObject srcEvaluated = m_src.eval();

because ei_eval<...>::type is not necessarily equal to
Derived::PlainObject and here, you really want to pass a reference to
Derived::PlainObject.

Any comments? Is there a particular reason why ei_nested<...>::type
should not be working out of the box?

Regards,
Hauke



Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/