mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-03-07 18:27:40 +08:00
Add evaluator for the experimental AlignedVector3
This commit is contained in:
parent
0ca43f7e9a
commit
060e835ee9
@ -57,6 +57,9 @@ template<typename _Scalar> class AlignedVector3
|
||||
|
||||
inline Index rows() const { return 3; }
|
||||
inline Index cols() const { return 1; }
|
||||
|
||||
Scalar* data() { return m_coeffs.data(); }
|
||||
const Scalar* data() const { return m_coeffs.data(); }
|
||||
|
||||
inline const Scalar& coeff(Index row, Index col) const
|
||||
{ return m_coeffs.coeff(row, col); }
|
||||
@ -183,6 +186,29 @@ template<typename _Scalar> class AlignedVector3
|
||||
}
|
||||
};
|
||||
|
||||
namespace internal {
|
||||
|
||||
template<typename Scalar>
|
||||
struct evaluator<AlignedVector3<Scalar> >
|
||||
: evaluator<Map<const Matrix<Scalar,3,1>,Aligned> >::type
|
||||
{
|
||||
typedef AlignedVector3<Scalar> XprType;
|
||||
typedef Map<const Matrix<Scalar,3,1>,Aligned> MapType;
|
||||
typedef typename evaluator<MapType>::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;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
//@}
|
||||
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user