MatrixFunctions: replace eval() by nested.

This eliminates an unnecessary copy in some situations, e.g. Map.
This commit is contained in:
Jitse Niesen
2013-07-31 14:57:20 +01:00
parent 43df1e707c
commit 68168e9eae
4 changed files with 29 additions and 24 deletions

View File

@@ -392,17 +392,14 @@ template<typename Derived> struct MatrixExponentialReturnValue
template <typename ResultType>
inline void evalTo(ResultType& result) const
{
const typename Derived::PlainObject srcEvaluated = m_src.eval();
internal::matrix_exp_compute(srcEvaluated, result);
internal::matrix_exp_compute(m_src, result);
}
Index rows() const { return m_src.rows(); }
Index cols() const { return m_src.cols(); }
protected:
const Derived& m_src;
private:
MatrixExponentialReturnValue& operator=(const MatrixExponentialReturnValue&);
const typename internal::nested<Derived, 10>::type m_src;
};
namespace internal {