mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-08-13 20:26:03 +08:00
Using StorageIndexType for loop assigning initial permutation. Adding assert for index overflow.
This commit is contained in:
parent
821ff0ecfb
commit
2946992ad4
@ -374,7 +374,9 @@ class PermutationMatrix : public PermutationBase<PermutationMatrix<SizeAtCompile
|
||||
PermutationMatrix(const Transpose<PermutationBase<Other> >& other)
|
||||
: m_indices(other.nestedPermutation().size())
|
||||
{
|
||||
for (typename IndicesType::Index i=0; i<m_indices.size();++i) m_indices.coeffRef(other.nestedPermutation().indices().coeff(i)) = i;
|
||||
eigen_internal_assert(m_indices.size() <= NumTraits<StorageIndexType>::highest());
|
||||
for (StorageIndexType i=0; i<m_indices.size();++i)
|
||||
m_indices.coeffRef(other.nestedPermutation().indices().coeff(i)) = i;
|
||||
}
|
||||
template<typename Lhs,typename Rhs>
|
||||
PermutationMatrix(internal::PermPermProduct_t, const Lhs& lhs, const Rhs& rhs)
|
||||
|
Loading…
x
Reference in New Issue
Block a user