Fix DenseBase::tail for Dynamic template argument

This commit is contained in:
Charles Schlosser 2024-10-12 21:03:30 +00:00
parent e0cbc55d92
commit b55dab7f21

View File

@ -1304,14 +1304,14 @@ EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ConstFixedSegmentReturnType<N>::T
template <int N> template <int N>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedSegmentReturnType<N>::Type tail(Index n = N) { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename FixedSegmentReturnType<N>::Type tail(Index n = N) {
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
return typename FixedSegmentReturnType<N>::Type(derived(), size() - n); return typename FixedSegmentReturnType<N>::Type(derived(), size() - n, n);
} }
/// This is the const version of tail<int>. /// This is the const version of tail<int>.
template <int N> template <int N>
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ConstFixedSegmentReturnType<N>::Type tail(Index n = N) const { EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE typename ConstFixedSegmentReturnType<N>::Type tail(Index n = N) const {
EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived) EIGEN_STATIC_ASSERT_VECTOR_ONLY(Derived)
return typename ConstFixedSegmentReturnType<N>::Type(derived(), size() - n); return typename ConstFixedSegmentReturnType<N>::Type(derived(), size() - n, n);
} }
/// \returns the \a outer -th column (resp. row) of the matrix \c *this if \c *this /// \returns the \a outer -th column (resp. row) of the matrix \c *this if \c *this