mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-11 19:29:02 +08:00
Make use of is_same_dense helper instead of extract_data to detect input/outputs are the same.
This commit is contained in:
parent
b7716c0328
commit
6f960b83ff
@ -1006,8 +1006,7 @@ struct transposition_matrix_product
|
||||
const Index size = tr.size();
|
||||
StorageIndex j = 0;
|
||||
|
||||
const typename Dest::Scalar *dst_data = internal::extract_data(dst);
|
||||
if(!(is_same<MatrixTypeCleaned,Dest>::value && dst_data!=0 && dst_data == extract_data(mat)))
|
||||
if(!is_same_dense(dst,mat))
|
||||
dst = mat;
|
||||
|
||||
for(Index k=(Transposed?size-1:0) ; Transposed?k>=0:k<size ; Transposed?--k:++k)
|
||||
|
@ -213,8 +213,7 @@ template<int Side, typename TriangularType, typename Rhs> struct triangular_solv
|
||||
|
||||
template<typename Dest> inline void evalTo(Dest& dst) const
|
||||
{
|
||||
const typename Dest::Scalar *dst_data = internal::extract_data(dst);
|
||||
if(!(is_same<RhsNestedCleaned,Dest>::value && dst_data!=0 && dst_data == extract_data(m_rhs)))
|
||||
if(!is_same_dense(dst,m_rhs))
|
||||
dst = m_rhs;
|
||||
m_triangularMatrix.template solveInPlace<Side>(dst);
|
||||
}
|
||||
|
@ -532,8 +532,7 @@ template<typename _MatrixType, unsigned int _Mode> class TriangularViewImpl<_Mat
|
||||
template<typename RhsType, typename DstType>
|
||||
EIGEN_DEVICE_FUNC
|
||||
EIGEN_STRONG_INLINE void _solve_impl(const RhsType &rhs, DstType &dst) const {
|
||||
const typename DstType::Scalar *dst_data = internal::extract_data(dst);
|
||||
if(!(internal::is_same<RhsType,DstType>::value && dst_data!=0 && dst_data == internal::extract_data(rhs)))
|
||||
if(!internal::is_same_dense(dst,rhs))
|
||||
dst = rhs;
|
||||
this->solveInPlace(dst);
|
||||
}
|
||||
|
@ -243,9 +243,7 @@ template<typename VectorsType, typename CoeffsType, int Side> class HouseholderS
|
||||
{
|
||||
workspace.resize(rows());
|
||||
Index vecs = m_length;
|
||||
const typename Dest::Scalar *dst_data = internal::extract_data(dst);
|
||||
if( internal::is_same<typename internal::remove_all<VectorsType>::type,Dest>::value
|
||||
&& dst_data!=0 && dst_data == internal::extract_data(m_vectors))
|
||||
if(is_same_dense(dst,m_vectors))
|
||||
{
|
||||
// in-place
|
||||
dst.diagonal().setOnes();
|
||||
|
Loading…
x
Reference in New Issue
Block a user