From 6f5c45ceff59b1167198755856f4cf32aa642312 Mon Sep 17 00:00:00 2001 From: Hauke Heibel Date: Wed, 15 Dec 2010 15:19:51 +0100 Subject: [PATCH] Fixed ctor from const raw data for Matrices and added the missing implementation for Arrays. Fixed a warning regarding the conversion from int to bool in MapBase. --- Eigen/Core | 2 +- Eigen/src/Core/Map.h | 9 ++++++++- Eigen/src/Core/MapBase.h | 2 +- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Eigen/Core b/Eigen/Core index b0310cb85..4100c435a 100644 --- a/Eigen/Core +++ b/Eigen/Core @@ -273,6 +273,7 @@ using std::size_t; #include "src/Core/NoAlias.h" #include "src/Core/PlainObjectBase.h" #include "src/Core/Matrix.h" +#include "src/Core/Array.h" #include "src/Core/CwiseBinaryOp.h" #include "src/Core/CwiseUnaryOp.h" #include "src/Core/CwiseNullaryOp.h" @@ -327,7 +328,6 @@ using std::size_t; #include "src/Core/Reverse.h" #include "src/Core/ArrayBase.h" #include "src/Core/ArrayWrapper.h" -#include "src/Core/Array.h" } // namespace Eigen diff --git a/Eigen/src/Core/Map.h b/Eigen/src/Core/Map.h index 0321f6669..b38b2f048 100644 --- a/Eigen/src/Core/Map.h +++ b/Eigen/src/Core/Map.h @@ -182,11 +182,18 @@ template class Ma StrideType m_stride; }; +template +inline Array<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> + ::Array(const Scalar *data) +{ + _set_noalias(Eigen::Map(data)); +} + template inline Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> ::Matrix(const Scalar *data) { - _set_noalias(Eigen::Map(data)); + _set_noalias(Eigen::Map(data)); } #endif // EIGEN_MAP_H diff --git a/Eigen/src/Core/MapBase.h b/Eigen/src/Core/MapBase.h index 42e36903d..b5bd7f964 100644 --- a/Eigen/src/Core/MapBase.h +++ b/Eigen/src/Core/MapBase.h @@ -56,7 +56,7 @@ template class MapBase typedef typename internal::packet_traits::type PacketScalar; typedef typename NumTraits::Real RealScalar; typedef typename internal::conditional< - int(internal::traits::Flags) & LvalueBit, + bool(int(internal::traits::Flags) & LvalueBit), Scalar *, const Scalar *>::type PointerType;