mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-12 19:59:05 +08:00
Fix inner-stride of AlignedVector3
This commit is contained in:
parent
2ae20d558b
commit
e70506dd8f
@ -60,6 +60,7 @@ template<typename _Scalar> class AlignedVector3
|
||||
|
||||
Scalar* data() { return m_coeffs.data(); }
|
||||
const Scalar* data() const { return m_coeffs.data(); }
|
||||
Index innerStride() const { return 1; }
|
||||
|
||||
inline const Scalar& coeff(Index row, Index col) const
|
||||
{ return m_coeffs.coeff(row, col); }
|
||||
@ -184,27 +185,24 @@ template<typename _Scalar> class AlignedVector3
|
||||
{
|
||||
return m_coeffs.template head<3>().isApprox(other,eps);
|
||||
}
|
||||
|
||||
CoeffType& coeffs() { return m_coeffs; }
|
||||
const CoeffType& coeffs() const { return m_coeffs; }
|
||||
};
|
||||
|
||||
namespace internal {
|
||||
|
||||
template<typename Scalar>
|
||||
struct evaluator<AlignedVector3<Scalar> >
|
||||
: evaluator<Map<const Matrix<Scalar,3,1>,Aligned> >::type
|
||||
: evaluator<Matrix<Scalar,4,1> >::type
|
||||
{
|
||||
typedef AlignedVector3<Scalar> XprType;
|
||||
typedef Map<const Matrix<Scalar,3,1>,Aligned> MapType;
|
||||
typedef typename evaluator<MapType>::type Base;
|
||||
typedef typename evaluator<Matrix<Scalar,4,1> >::type Base;
|
||||
|
||||
typedef evaluator type;
|
||||
typedef evaluator nestedType;
|
||||
|
||||
evaluator(const XprType &m) : Base(MapType(m.data())), m_map(m.data())
|
||||
{
|
||||
::new (static_cast<Base*>(this)) Base(m_map);
|
||||
}
|
||||
|
||||
const MapType m_map;
|
||||
evaluator(const XprType &m) : Base(m.coeffs()) {}
|
||||
};
|
||||
|
||||
}
|
||||
|
@ -29,8 +29,8 @@ endif(ADOLC_FOUND)
|
||||
ei_add_test(NonLinearOptimization)
|
||||
|
||||
ei_add_test(NumericalDiff)
|
||||
# TODO ei_add_test(autodiff_scalar)
|
||||
# TODO ei_add_test(autodiff)
|
||||
ei_add_test(autodiff_scalar)
|
||||
ei_add_test(autodiff)
|
||||
|
||||
if (NOT CMAKE_CXX_COMPILER MATCHES "clang\\+\\+$")
|
||||
ei_add_test(BVH)
|
||||
|
Loading…
x
Reference in New Issue
Block a user