diff options
author | Benjamin Barenblat <bbaren@google.com> | 2021-07-07 17:12:12 -0400 |
---|---|---|
committer | Benjamin Barenblat <bbaren@google.com> | 2021-07-07 17:14:08 -0400 |
commit | 27e7fd18f1c337c409f2a567697b27bcd0c09f8b (patch) | |
tree | 5ff36982295b5c6c528a26d87e950af015656cde /Eigen/src/SparseLU/SparseLU_Memory.h | |
parent | a59cf78c8d197e2892ec11985a07c98c362e1600 (diff) |
Rename EIGEN_EXCEPTIONS to EIGEN_USE_EXCEPTIONS, and allow disabling
exceptions with -DEIGEN_USE_EXCEPTIONS=0.
Diffstat (limited to 'Eigen/src/SparseLU/SparseLU_Memory.h')
-rw-r--r-- | Eigen/src/SparseLU/SparseLU_Memory.h | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/Eigen/src/SparseLU/SparseLU_Memory.h b/Eigen/src/SparseLU/SparseLU_Memory.h index 349bfd585..711cb7ec3 100644 --- a/Eigen/src/SparseLU/SparseLU_Memory.h +++ b/Eigen/src/SparseLU/SparseLU_Memory.h @@ -76,13 +76,11 @@ Index SparseLUImpl<Scalar,StorageIndex>::expand(VectorType& vec, Index& length, old_vec = vec.segment(0,nbElts); //Allocate or expand the current vector -#ifdef EIGEN_EXCEPTIONS - try -#endif + EIGEN_TRY { vec.resize(new_len); } -#ifdef EIGEN_EXCEPTIONS +#if EIGEN_USE_EXCEPTIONS catch(std::bad_alloc& ) #else if(!vec.size()) @@ -107,13 +105,11 @@ Index SparseLUImpl<Scalar,StorageIndex>::expand(VectorType& vec, Index& length, { alpha = (alpha + 1)/2; new_len = (std::max)(length+1,Index(alpha * length)); -#ifdef EIGEN_EXCEPTIONS - try -#endif + EIGEN_TRY { vec.resize(new_len); } -#ifdef EIGEN_EXCEPTIONS +#if EIGEN_USE_EXCEPTIONS catch(std::bad_alloc& ) #else if (!vec.size()) |