diff options
author | Deanna Hood <deanna.m.hood@gmail.com> | 2015-04-20 14:01:35 -0400 |
---|---|---|
committer | Deanna Hood <deanna.m.hood@gmail.com> | 2015-04-20 14:01:35 -0400 |
commit | 0250f4a9f2f7bb54ed760cec045939a1bbe58170 (patch) | |
tree | 5e0372ddef57f51f7adb56bb9569037e6e9556ad /Eigen/src/SparseCore/CompressedStorage.h | |
parent | 0339502a4feb6340f1e9f6f6ca8b3ef4d263f366 (diff) | |
parent | 0eb220c00d9773c29c7d169ad0e20745b0ef21bb (diff) |
Merged default into unary-array-cwise-functors
Diffstat (limited to 'Eigen/src/SparseCore/CompressedStorage.h')
-rw-r--r-- | Eigen/src/SparseCore/CompressedStorage.h | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Eigen/src/SparseCore/CompressedStorage.h b/Eigen/src/SparseCore/CompressedStorage.h index 49fd46658..52c7da297 100644 --- a/Eigen/src/SparseCore/CompressedStorage.h +++ b/Eigen/src/SparseCore/CompressedStorage.h @@ -86,7 +86,12 @@ class CompressedStorage void resize(Index size, double reserveSizeFactor = 0) { if (m_allocatedSize<size) - reallocate(size + Index(reserveSizeFactor*double(size))); + { + Index realloc_size = (std::min<Index>)(NumTraits<StorageIndex>::highest(), size + Index(reserveSizeFactor*double(size))); + if(realloc_size<size) + internal::throw_std_bad_alloc(); + reallocate(realloc_size); + } m_size = size; } |