diff options
author | Hauke Heibel <hauke.heibel@gmail.com> | 2010-12-15 15:19:51 +0100 |
---|---|---|
committer | Hauke Heibel <hauke.heibel@gmail.com> | 2010-12-15 15:19:51 +0100 |
commit | 6f5c45ceff59b1167198755856f4cf32aa642312 (patch) | |
tree | 4f01b6bd0e8f7d082ef94f74db0b7b6374adcea1 /Eigen | |
parent | 6a9a6bbc78c05381b021122a24e22019a9dc99da (diff) |
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.
Diffstat (limited to 'Eigen')
-rw-r--r-- | Eigen/Core | 2 | ||||
-rw-r--r-- | Eigen/src/Core/Map.h | 9 | ||||
-rw-r--r-- | 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 @@ -183,10 +183,17 @@ template<typename PlainObjectType, int MapOptions, typename StrideType> class Ma }; template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols> +inline Array<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> + ::Array(const Scalar *data) +{ + _set_noalias(Eigen::Map<const Array>(data)); +} + +template<typename _Scalar, int _Rows, int _Cols, int _Options, int _MaxRows, int _MaxCols> inline Matrix<_Scalar, _Rows, _Cols, _Options, _MaxRows, _MaxCols> ::Matrix(const Scalar *data) { - _set_noalias(Eigen::Map<Matrix>(data)); + _set_noalias(Eigen::Map<const Matrix>(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<typename Derived> class MapBase<Derived, ReadOnlyAccessors> typedef typename internal::packet_traits<Scalar>::type PacketScalar; typedef typename NumTraits<Scalar>::Real RealScalar; typedef typename internal::conditional< - int(internal::traits<Derived>::Flags) & LvalueBit, + bool(int(internal::traits<Derived>::Flags) & LvalueBit), Scalar *, const Scalar *>::type PointerType; |