aboutsummaryrefslogtreecommitdiffhomepage
path: root/unsupported/Eigen/src/MatrixFunctions
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2014-09-18 17:31:17 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2014-09-18 17:31:17 +0200
commit62bce6e5e6da71dd8d85ae229d24b9f9f13d1681 (patch)
tree9c2bff02dc2e1ae21bbe698b466a74e1d9bb5966 /unsupported/Eigen/src/MatrixFunctions
parent060e835ee9f7a3abb9ff3d9f2522027bf2f98efe (diff)
Make MatrixFunction use nested_eval instead of nested
Diffstat (limited to 'unsupported/Eigen/src/MatrixFunctions')
-rw-r--r--unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h5
-rw-r--r--unsupported/Eigen/src/MatrixFunctions/MatrixFunction.h11
-rw-r--r--unsupported/Eigen/src/MatrixFunctions/MatrixLogarithm.h11
-rw-r--r--unsupported/Eigen/src/MatrixFunctions/MatrixSquareRoot.h8
4 files changed, 20 insertions, 15 deletions
diff --git a/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h b/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h
index 160120d03..9e0545660 100644
--- a/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h
+++ b/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h
@@ -392,14 +392,15 @@ template<typename Derived> struct MatrixExponentialReturnValue
template <typename ResultType>
inline void evalTo(ResultType& result) const
{
- internal::matrix_exp_compute(m_src, result);
+ const typename internal::nested_eval<Derived, 10>::type tmp(m_src);
+ internal::matrix_exp_compute(tmp, result);
}
Index rows() const { return m_src.rows(); }
Index cols() const { return m_src.cols(); }
protected:
- const typename internal::nested<Derived, 10>::type m_src;
+ const typename internal::nested<Derived>::type m_src;
};
namespace internal {
diff --git a/unsupported/Eigen/src/MatrixFunctions/MatrixFunction.h b/unsupported/Eigen/src/MatrixFunctions/MatrixFunction.h
index a35c11be5..b68aae5e8 100644
--- a/unsupported/Eigen/src/MatrixFunctions/MatrixFunction.h
+++ b/unsupported/Eigen/src/MatrixFunctions/MatrixFunction.h
@@ -485,7 +485,7 @@ template<typename Derived> class MatrixFunctionReturnValue
typedef typename internal::stem_function<Scalar>::type StemFunction;
protected:
- typedef typename internal::nested<Derived, 10>::type DerivedNested;
+ typedef typename internal::nested<Derived>::type DerivedNested;
public:
@@ -503,18 +503,19 @@ template<typename Derived> class MatrixFunctionReturnValue
template <typename ResultType>
inline void evalTo(ResultType& result) const
{
- typedef typename internal::remove_all<DerivedNested>::type DerivedNestedClean;
- typedef internal::traits<DerivedNestedClean> Traits;
+ typedef typename internal::nested_eval<Derived, 10>::type NestedEvalType;
+ typedef typename internal::remove_all<NestedEvalType>::type NestedEvalTypeClean;
+ typedef internal::traits<NestedEvalTypeClean> Traits;
static const int RowsAtCompileTime = Traits::RowsAtCompileTime;
static const int ColsAtCompileTime = Traits::ColsAtCompileTime;
- static const int Options = DerivedNestedClean::Options;
+ static const int Options = NestedEvalTypeClean::Options;
typedef std::complex<typename NumTraits<Scalar>::Real> ComplexScalar;
typedef Matrix<ComplexScalar, Dynamic, Dynamic, Options, RowsAtCompileTime, ColsAtCompileTime> DynMatrixType;
typedef internal::MatrixFunctionAtomic<DynMatrixType> AtomicType;
AtomicType atomic(m_f);
- internal::matrix_function_compute<DerivedNestedClean>::run(m_A, atomic, result);
+ internal::matrix_function_compute<NestedEvalTypeClean>::run(m_A, atomic, result);
}
Index rows() const { return m_A.rows(); }
diff --git a/unsupported/Eigen/src/MatrixFunctions/MatrixLogarithm.h b/unsupported/Eigen/src/MatrixFunctions/MatrixLogarithm.h
index d46ccc145..42b60b9b1 100644
--- a/unsupported/Eigen/src/MatrixFunctions/MatrixLogarithm.h
+++ b/unsupported/Eigen/src/MatrixFunctions/MatrixLogarithm.h
@@ -310,7 +310,7 @@ public:
typedef typename Derived::Index Index;
protected:
- typedef typename internal::nested<Derived, 10>::type DerivedNested;
+ typedef typename internal::nested<Derived>::type DerivedNested;
public:
@@ -327,17 +327,18 @@ public:
template <typename ResultType>
inline void evalTo(ResultType& result) const
{
- typedef typename internal::remove_all<DerivedNested>::type DerivedNestedClean;
- typedef internal::traits<DerivedNestedClean> Traits;
+ typedef typename internal::nested_eval<Derived, 10>::type DerivedEvalType;
+ typedef typename internal::remove_all<DerivedEvalType>::type DerivedEvalTypeClean;
+ typedef internal::traits<DerivedEvalTypeClean> Traits;
static const int RowsAtCompileTime = Traits::RowsAtCompileTime;
static const int ColsAtCompileTime = Traits::ColsAtCompileTime;
- static const int Options = DerivedNestedClean::Options;
+ static const int Options = DerivedEvalTypeClean::Options;
typedef std::complex<typename NumTraits<Scalar>::Real> ComplexScalar;
typedef Matrix<ComplexScalar, Dynamic, Dynamic, Options, RowsAtCompileTime, ColsAtCompileTime> DynMatrixType;
typedef internal::MatrixLogarithmAtomic<DynMatrixType> AtomicType;
AtomicType atomic;
- internal::matrix_function_compute<DerivedNestedClean>::run(m_A, atomic, result);
+ internal::matrix_function_compute<DerivedEvalTypeClean>::run(m_A, atomic, result);
}
Index rows() const { return m_A.rows(); }
diff --git a/unsupported/Eigen/src/MatrixFunctions/MatrixSquareRoot.h b/unsupported/Eigen/src/MatrixFunctions/MatrixSquareRoot.h
index 8ca4f4864..3a4d6eb3f 100644
--- a/unsupported/Eigen/src/MatrixFunctions/MatrixSquareRoot.h
+++ b/unsupported/Eigen/src/MatrixFunctions/MatrixSquareRoot.h
@@ -320,7 +320,7 @@ template<typename Derived> class MatrixSquareRootReturnValue
{
protected:
typedef typename Derived::Index Index;
- typedef typename internal::nested<Derived, 10>::type DerivedNested;
+ typedef typename internal::nested<Derived>::type DerivedNested;
public:
/** \brief Constructor.
@@ -338,8 +338,10 @@ template<typename Derived> class MatrixSquareRootReturnValue
template <typename ResultType>
inline void evalTo(ResultType& result) const
{
- typedef typename internal::remove_all<DerivedNested>::type DerivedNestedClean;
- internal::matrix_sqrt_compute<DerivedNestedClean>::run(m_src, result);
+ typedef typename internal::nested_eval<Derived, 10>::type DerivedEvalType;
+ typedef typename internal::remove_all<DerivedEvalType>::type DerivedEvalTypeClean;
+ DerivedEvalType tmp(m_src);
+ internal::matrix_sqrt_compute<DerivedEvalTypeClean>::run(tmp, result);
}
Index rows() const { return m_src.rows(); }