32 #ifndef _mpqc_src_lib_chemistry_qc_libint2_core_ints_engine_h
33 #define _mpqc_src_lib_chemistry_qc_libint2_core_ints_engine_h
35 #include <util/ref/ref.h>
36 #include <util/group/thread.h>
46 template <
typename _Engine>
54 Engine(
int mmax,
double prec = 1e-15):
RefCount(), _Engine(mmax, prec) {}
57 template <
typename Int>
59 if (default_engine_->max_m() >= mmax)
60 return default_engine_;
64 default_engine_ = new_default_engine;
65 return default_engine_;
68 template <
typename Int,
typename Real>
70 if (not (default_engine_->max_m() < mmax || default_engine_->precision() > prec))
71 return default_engine_;
74 Ref<Engine> new_default_engine =
new Engine(mmax, prec);
75 default_engine_ = new_default_engine;
76 return default_engine_;
80 static Ref<Engine> default_engine_;
81 static Ref<ThreadLock> lock_;
84 template <
typename _Engine>
89 #endif // end of header guard