21 #ifndef _libint2_src_bin_libint_policy_h_ 22 #define _libint2_src_bin_libint_policy_h_ 25 #include <smart_ptr.h> 28 #include <boost/type_traits/is_same.hpp> 38 template <
class T,
bool exists>
39 struct ExistsDefaultSubobjAllocator;
42 struct ExistsDefaultSubobjAllocator<T,true>{
44 typedef typename TypeTraits<obj_type>::StorageType obj_stype;
45 typedef typename TypeTraits<obj_type>::StorageType subobj_stype;
46 typedef typename obj_type::iter_type subobj_type;
48 static void default_init_subobj(
const obj_stype& obj, vector<subobj_stype>& subobj)
50 subobj.push_back(obj);
52 static void default_dealloc_subobj(vector<subobj_stype>& subobj)
62 struct StdLibintTDPolicy {
64 typedef typename obj_type::iter_type subobj_type;
66 typedef typename TypeTraits<obj_type>::StorageType obj_stype;
68 typedef typename TypeTraits<subobj_type>::StorageType subobj_stype;
71 static void init_subobj(
const obj_stype& obj, vector<subobj_stype>& subobj)
74 ExistsDefaultSubobjAllocator< T, boost::is_same<obj_type,subobj_type>::value >::default_init_subobj(obj,subobj);
76 static void dealloc_subobj(vector<subobj_stype>& subobj)
79 ExistsDefaultSubobjAllocator< T, boost::is_same<obj_type,subobj_type>::value >::default_dealloc_subobj(subobj);
87 class StdLibintTIPolicy {
90 static unsigned int max_set_size_to_unroll_;
94 StdLibintTIPolicy() {}
96 virtual void set_max_set_size_to_unroll(
unsigned int i)
98 max_set_size_to_unroll_ = i;
101 virtual unsigned int max_set_size_to_unroll()
const 103 return max_set_size_to_unroll_;
113 #if CXX_ALLOWS_DEFPARAMTEMPLATE_AS_TEMPTEMPPARAM 114 template <
class T,
class TIPol = StdLib
intTIPolicy,
template <
class>
class TDPol = StdLibintTDPolicy>
115 class Policy :
public TDPol<T>,
public TIPol
118 #define TDPol StdLibintTDPolicy 119 #define TIPol StdLibintTIPolicy 121 class Policy :
public TDPol<T>,
public TIPol
126 typedef typename TDPol<T>::obj_stype obj_stype;
128 typedef typename TDPol<T>::subobj_stype subobj_stype;
147 bool can_unroll_intset(
const SafePtr<T>& iset)
149 return iset->set_size() <= TIPol::max_set_size_to_unroll();
Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:24