21 #ifndef _libint2_src_bin_libint_iface_h_ 22 #define _libint2_src_bin_libint_iface_h_ 26 #include <smart_ptr.h> 27 #include <default_params.h> 45 typedef std::vector<std::string> Tasks;
46 Libint2Iface(
const SafePtr<CompilationParameters>& cparams,
47 const SafePtr<CodeContext>& ctext);
79 std::string
macro(
const std::string& label) {
80 std::string result(
"LIBINT2_"); result += label;
84 std::string macro(
const std::string& task_label,
const std::string& label) {
85 std::string result(
"LIBINT2_"); result += label;
if (task_label !=
"") { result +=
"_"; result += task_label; }
89 template <
typename T> std::string macro_define(
const std::string& label,
const T& value) {
91 oss_ <<
"#ifndef " << macro(label) << endl;
92 oss_ <<
"# define " << macro(label) <<
" " << value << endl;
93 oss_ <<
"#endif" << endl;
97 template <
typename T> std::string macro_define(
const std::string& task_label,
const std::string& label,
const T& value) {
99 oss_ <<
"#define " << macro(task_label,label) <<
" " << value << endl;
103 template <
typename T> std::string var_declare_v(
const std::string& label) {
104 return ctext_->declare_v(ctext_->type_name<T>(),ctext_->label_to_name(label),macro(
"MAX_VECLEN"));
108 std::string null_str_;
109 std::ostringstream oss_;
110 SafePtr<CompilationParameters> cparams_;
111 SafePtr<CodeContext> ctext_;
115 std::vector<std::string> li_decls_;
116 std::vector<std::string> lm_decls_;
117 std::vector<std::string> lc_decls_;
119 std::string lf_decl_;
121 typedef std::basic_ofstream<char> fstream;
131 void generate_inteval_type(std::ostream& os);
void to_static_init(const std::string &s)
Writes string s to the static init code.
Definition: iface.h:67
Libint2Iface is used to generate Libint2 interfaces.
Definition: iface.h:43
Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:24
void to_int_iface(const std::string &s)
Writes string s to the internal iface header.
Definition: iface.h:63
void to_params(const std::string &s)
Writes string s to the params header.
Definition: iface.h:55
void to_types(const std::string &s)
Writes string s to the types header.
Definition: iface.h:51
void to_iface(const std::string &s)
Writes string s to the iface header.
Definition: iface.h:59
void to_static_cleanup(const std::string &s)
Writes string s to the static cleanup code.
Definition: iface.h:71
std::string macro(const std::string &label)
Writes string s to the Libint_t init code.
Definition: iface.h:79