From 27e7fd18f1c337c409f2a567697b27bcd0c09f8b Mon Sep 17 00:00:00 2001 From: Benjamin Barenblat Date: Wed, 7 Jul 2021 17:12:12 -0400 Subject: Support manually disabling exceptions Rename EIGEN_EXCEPTIONS to EIGEN_USE_EXCEPTIONS, and allow disabling exceptions with -DEIGEN_USE_EXCEPTIONS=0. --- Eigen/src/SparseLU/SparseLU_Memory.h | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) (limited to 'Eigen/src/SparseLU/SparseLU_Memory.h') 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::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::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()) -- cgit v1.2.3