diff --git a/configure.ac b/configure.ac index 8ca43e3e..aded39d1 100644 --- a/configure.ac +++ b/configure.ac @@ -341,6 +341,7 @@ esac ) LIBINT_HARD_MAX_AM=12 +AC_DEFINE_UNQUOTED(LIBINT_HARD_MAX_AM,$LIBINT_HARD_MAX_AM) LIBINT_MAX_AM=4 AC_ARG_WITH(max-am, AS_HELP_STRING([--with-max-am=N],[Support Gaussians of angular momentum up to N. Can specify values for each derivative levels as a list N0,N1,N2...]), diff --git a/include/libint2/config.h.in b/include/libint2/config.h.in index bd42b26e..8c807f5f 100644 --- a/include/libint2/config.h.in +++ b/include/libint2/config.h.in @@ -47,6 +47,9 @@ /* Prefix for all names in API */ #undef LIBINT_API_PREFIX +/* Max AM supported by Libint *in principle* */ +#undef LIBINT_HARD_MAX_AM + /* Max AM (same for all derivatives; if not defined see LIBINT_MAX_AM_LIST) */ #undef LIBINT_MAX_AM diff --git a/include/libint2/solidharmonics.h b/include/libint2/solidharmonics.h index d09705f6..166bc23e 100644 --- a/include/libint2/solidharmonics.h +++ b/include/libint2/solidharmonics.h @@ -83,7 +83,8 @@ class SolidHarmonicsCoefficients { static const SolidHarmonicsCoefficients& instance(unsigned int l) { static std::vector shg_coefs( SolidHarmonicsCoefficients::CtorHelperIter(0), - SolidHarmonicsCoefficients::CtorHelperIter(13)); + SolidHarmonicsCoefficients::CtorHelperIter(LIBINT_HARD_MAX_AM + 1)); + assert(l < shg_coefs.size()); return shg_coefs[l]; }