LIBINT 2.9.0
configuration.h
1/*
2 * Copyright (C) 2004-2024 Edward F. Valeev
3 *
4 * This file is part of Libint library.
5 *
6 * Libint library is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU Lesser General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * Libint library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public License
17 * along with Libint library. If not, see <http://www.gnu.org/licenses/>.
18 *
19 */
20
21#ifndef _libint2_include_libint2_util_configuration_h_
22#define _libint2_include_libint2_util_configuration_h_
23
24/* Runtime accessor for the library configuration:
25 integral derivatives, AM, orderings, etc.
26 @return the semicolon-separated strings from CMake components */
27const char* configuration_accessor();
28
29#ifdef __cplusplus
30#include <algorithm>
31#include <sstream>
32#include <string>
33#include <vector>
34
35namespace libint2 {
36
40inline std::string configuration_accessor() {
41 std::string components = ::configuration_accessor();
42 return components;
43}
44
49inline bool supports(std::string component) {
50 std::string segment;
51 std::vector<std::string> seglist;
52 std::stringstream ca(configuration_accessor());
53 while (std::getline(ca, segment, ';')) {
54 seglist.push_back(segment);
55 }
56 bool tf =
57 (std::find(seglist.begin(), seglist.end(), component) != seglist.end());
58 return tf;
59}
60} // namespace libint2
61#endif /* C++ guard */
62
63#endif /* header guard */
Defaults definitions for various parameters assumed by Libint.
Definition algebra.cc:24
std::string configuration_accessor()
Runtime accessor for the library configuration: integral derivatives, AM, orderings,...
Definition configuration.h:40
bool supports(std::string component)
Runtime accessor for individual library configuration components: integral derivatives,...
Definition configuration.h:49