aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/PermutationMatrix.h
diff options
context:
space:
mode:
authorGravatar Christoph Hertzberg <chtz@informatik.uni-bremen.de>2014-09-23 14:28:23 +0200
committerGravatar Christoph Hertzberg <chtz@informatik.uni-bremen.de>2014-09-23 14:28:23 +0200
commit36448c9e287935b8c408791bf88b2907292d6c80 (patch)
tree841afdf4ea165433ad3b0f797498441815344eeb /Eigen/src/Core/PermutationMatrix.h
parentde0d8a010e8cee66901786e0e2819beeaa5cb253 (diff)
Make constructors explicit if they could lead to unintended implicit conversion
Diffstat (limited to 'Eigen/src/Core/PermutationMatrix.h')
-rw-r--r--Eigen/src/Core/PermutationMatrix.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/Eigen/src/Core/PermutationMatrix.h b/Eigen/src/Core/PermutationMatrix.h
index 200518173..98c83047a 100644
--- a/Eigen/src/Core/PermutationMatrix.h
+++ b/Eigen/src/Core/PermutationMatrix.h
@@ -73,6 +73,7 @@ class PermutationBase : public EigenBase<Derived>
typedef PermutationMatrix<IndicesType::SizeAtCompileTime,IndicesType::MaxSizeAtCompileTime,StorageIndexType>
PlainPermutationType;
using Base::derived;
+ typedef Transpose<PermutationBase> TransposeReturnType;
#endif
/** Copies the other permutation into *this */
@@ -198,14 +199,14 @@ class PermutationBase : public EigenBase<Derived>
*
* \note \note_try_to_help_rvo
*/
- inline Transpose<PermutationBase> inverse() const
- { return derived(); }
+ inline TransposeReturnType inverse() const
+ { return TransposeReturnType(derived()); }
/** \returns the tranpose permutation matrix.
*
* \note \note_try_to_help_rvo
*/
- inline Transpose<PermutationBase> transpose() const
- { return derived(); }
+ inline TransposeReturnType transpose() const
+ { return TransposeReturnType(derived()); }
/**** multiplication helpers to hopefully get RVO ****/
@@ -301,7 +302,7 @@ class PermutationMatrix : public PermutationBase<PermutationMatrix<SizeAtCompile
/** Constructs an uninitialized permutation matrix of given size.
*/
- inline PermutationMatrix(Index size) : m_indices(size)
+ explicit inline PermutationMatrix(Index size) : m_indices(size)
{}
/** Copy constructor. */