aboutsummaryrefslogtreecommitdiffhomepage
path: root/Eigen/src/Core/PermutationMatrix.h
diff options
context:
space:
mode:
Diffstat (limited to 'Eigen/src/Core/PermutationMatrix.h')
-rw-r--r--Eigen/src/Core/PermutationMatrix.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/Eigen/src/Core/PermutationMatrix.h b/Eigen/src/Core/PermutationMatrix.h
index 1da27c06c..de824c129 100644
--- a/Eigen/src/Core/PermutationMatrix.h
+++ b/Eigen/src/Core/PermutationMatrix.h
@@ -147,7 +147,8 @@ class PermutationBase : public EigenBase<Derived>
/** Sets *this to be the identity permutation matrix */
void setIdentity()
{
- for(Index i = 0; i < size(); ++i)
+ StorageIndex n = StorageIndex(size());
+ for(StorageIndex i = 0; i < n; ++i)
indices().coeffRef(i) = i;
}