aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2016-12-13 23:10:27 +0100
committerGravatar Gael Guennebaud <g.gael@free.fr>2016-12-13 23:10:27 +0100
commitc817ce3ba3f5fcc9cc52e761df2b4f4d20b0d336 (patch)
treecd73c5afc98078740a909fe26fb0c964ab451ab1
parenta432fc102df1fc9b0f14b2abda5f57ed3993de16 (diff)
bug #1361: fix compilation issue in mat=perm.inverse()
-rw-r--r--Eigen/src/Core/Inverse.h1
-rw-r--r--test/permutationmatrices.cpp9
2 files changed, 9 insertions, 1 deletions
diff --git a/Eigen/src/Core/Inverse.h b/Eigen/src/Core/Inverse.h
index f303aebf9..b76f0439d 100644
--- a/Eigen/src/Core/Inverse.h
+++ b/Eigen/src/Core/Inverse.h
@@ -45,6 +45,7 @@ class Inverse : public InverseImpl<XprType,typename internal::traits<XprType>::S
public:
typedef typename XprType::StorageIndex StorageIndex;
typedef typename XprType::PlainObject PlainObject;
+ typedef typename XprType::Scalar Scalar;
typedef typename internal::ref_selector<XprType>::type XprTypeNested;
typedef typename internal::remove_all<XprTypeNested>::type XprTypeNestedCleaned;
typedef typename internal::ref_selector<Inverse>::type Nested;
diff --git a/test/permutationmatrices.cpp b/test/permutationmatrices.cpp
index 41aa57d6d..70b469ebc 100644
--- a/test/permutationmatrices.cpp
+++ b/test/permutationmatrices.cpp
@@ -108,7 +108,14 @@ template<typename MatrixType> void permutationmatrices(const MatrixType& m)
rm = rp;
rm.col(i).swap(rm.col(j));
VERIFY_IS_APPROX(rm, rp2.toDenseMatrix().template cast<Scalar>());
- }
+ }
+
+ {
+ // simple compilation check
+ Matrix<Scalar, Cols, Cols> A = rp;
+ Matrix<Scalar, Cols, Cols> B = rp.transpose();
+ VERIFY_IS_APPROX(A, B.transpose());
+ }
}
template<typename T>