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.
This commit is contained in:
Hauke Heibel 2010-12-15 15:19:51 +01:00
parent 6a9a6bbc78
commit 6f5c45ceff
3 changed files with 10 additions and 3 deletions

View File

@ -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

View File

@ -182,11 +182,18 @@ template<typename PlainObjectType, int MapOptions, typename StrideType> class Ma
StrideType m_stride;
};
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

View File

@ -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;