diff --git a/include/libint2/dfbs_generator.h b/include/libint2/dfbs_generator.h index 19ddfd777..1104f5d3e 100644 --- a/include/libint2/dfbs_generator.h +++ b/include/libint2/dfbs_generator.h @@ -38,7 +38,7 @@ namespace libint2 { /// Computes uncontracted shells from a vector of shells /// @param[in] cluster a vector of shells /// @return a vector of uncontracted shells - std::vector uncontract( + inline std::vector uncontract( const std::vector &cluster) { std::vector primitive_cluster; for (const auto &contracted_shell: cluster) { @@ -56,7 +56,7 @@ namespace libint2 { /// @brief returns \Gamma(x) of x - double gamma_function(const double &x) { + inline double gamma_function(const double &x) { return std::tgamma(x); } @@ -65,7 +65,7 @@ namespace libint2 { /// @param shell2 second shell /// @param L total angular momentum of product function /// @return effective exponent of product function - double alpha_eff(const Shell &shell1, const Shell &shell2, const int &L) { + inline double alpha_eff(const Shell &shell1, const Shell &shell2, const int &L) { auto alpha1 = shell1.alpha[0]; auto alpha2 = shell2.alpha[0]; auto l1 = shell1.contr[0].l; @@ -78,7 +78,7 @@ namespace libint2 { /// @brief creates a set of product functions from a set of primitive shells /// @param primitive_shells set of primitive shells - std::vector product_functions(const std::vector &primitive_shells) { + inline std::vector product_functions(const std::vector &primitive_shells) { std::vector product_functions; for (auto i = 0; i < primitive_shells.size(); ++i) { for (auto j = 0; j <= i; ++j) { @@ -106,7 +106,7 @@ namespace libint2 { /// @brief creates a set of candidate product shells from a set of primitive shells /// @param primitive_shells set of primitive shells /// @return set of candidate product shells - std::vector> candidate_functions(const std::vector> &primitive_shells) { + inline std::vector> candidate_functions(const std::vector> &primitive_shells) { std::vector> candidate_functions; for (auto i = 0; i < primitive_shells.size(); ++i) { candidate_functions.push_back(product_functions(primitive_shells[i])); @@ -115,7 +115,7 @@ namespace libint2 { } /// @brief returns a hash map of shell indices to basis function indices - std::vector map_shell_to_basis_function(const std::vector &shells) { + inline std::vector map_shell_to_basis_function(const std::vector &shells) { std::vector result; result.reserve(shells.size()); @@ -131,7 +131,7 @@ namespace libint2 { /// @brief computes the Coulomb matrix (\mu|rij^{-1}|\nu) for a set of shells /// @param shells set of shells /// @return Coulomb matrix - Eigen::MatrixXd compute_coulomb_matrix(const std::vector &shells) { + inline Eigen::MatrixXd compute_coulomb_matrix(const std::vector &shells) { const auto n = nbf(shells); Eigen::MatrixXd result = Eigen::MatrixXd::Zero(n, n); using libint2::Engine; @@ -157,7 +157,7 @@ namespace libint2 { } /// @brief Sorts a vector of shells by angular momentum - std::vector> split_by_L(const std::vector &shells) { + inline std::vector> split_by_L(const std::vector &shells) { int lmax = max_l(shells); std::vector> sorted_shells; sorted_shells.resize(lmax + 1); @@ -172,7 +172,7 @@ namespace libint2 { /// @param shells set of shells /// @param cholesky_threshold threshold for choosing a product function via pivoted Cholesky decomposition /// @return reduced set of product functions - std::vector shell_pivoted_cholesky(const std::vector shells, const double cholesky_threshold) { + inline std::vector shell_pivoted_cholesky(const std::vector shells, const double cholesky_threshold) { auto n = shells.size(); // number of shells std::vector shell_indices; // hash map of basis function indices to shell indices diff --git a/include/libint2/pivoted_cholesky.h b/include/libint2/pivoted_cholesky.h index 6eb695f78..6e19d4921 100644 --- a/include/libint2/pivoted_cholesky.h +++ b/include/libint2/pivoted_cholesky.h @@ -17,7 +17,7 @@ namespace libint2 { /// @param tolerance tolerance for the error /// @param pivot initial pivot indices /// @return pivoted Cholesky decomposition of A - std::vector + inline std::vector pivoted_cholesky(const Eigen::MatrixXd &A, const double &tolerance, const std::vector &pivot) { // number of elements in A auto n = A.rows();