20 #ifndef _libint2_src_bin_libint_policy_h_ 21 #define _libint2_src_bin_libint_policy_h_ 24 #include <smart_ptr.h> 27 #include <boost/type_traits/is_same.hpp> 37 template <
class T,
bool exists>
38 struct ExistsDefaultSubobjAllocator;
41 struct ExistsDefaultSubobjAllocator<T,true>{
43 typedef typename TypeTraits<obj_type>::StorageType obj_stype;
44 typedef typename TypeTraits<obj_type>::StorageType subobj_stype;
45 typedef typename obj_type::iter_type subobj_type;
47 static void default_init_subobj(
const obj_stype& obj, vector<subobj_stype>& subobj)
49 subobj.push_back(obj);
51 static void default_dealloc_subobj(vector<subobj_stype>& subobj)
61 struct StdLibintTDPolicy {
63 typedef typename obj_type::iter_type subobj_type;
65 typedef typename TypeTraits<obj_type>::StorageType obj_stype;
67 typedef typename TypeTraits<subobj_type>::StorageType subobj_stype;
70 static void init_subobj(
const obj_stype& obj, vector<subobj_stype>& subobj)
73 ExistsDefaultSubobjAllocator< T, boost::is_same<obj_type,subobj_type>::value >::default_init_subobj(obj,subobj);
75 static void dealloc_subobj(vector<subobj_stype>& subobj)
78 ExistsDefaultSubobjAllocator< T, boost::is_same<obj_type,subobj_type>::value >::default_dealloc_subobj(subobj);
86 class StdLibintTIPolicy {
89 static unsigned int max_set_size_to_unroll_;
93 StdLibintTIPolicy() {}
95 virtual void set_max_set_size_to_unroll(
unsigned int i)
97 max_set_size_to_unroll_ = i;
100 virtual unsigned int max_set_size_to_unroll()
const 102 return max_set_size_to_unroll_;
112 #if CXX_ALLOWS_DEFPARAMTEMPLATE_AS_TEMPTEMPPARAM 113 template <
class T,
class TIPol = StdLib
intTIPolicy,
template <
class>
class TDPol = StdLibintTDPolicy>
114 class Policy :
public TDPol<T>,
public TIPol
117 #define TDPol StdLibintTDPolicy 118 #define TIPol StdLibintTIPolicy 120 class Policy :
public TDPol<T>,
public TIPol
125 typedef typename TDPol<T>::obj_stype obj_stype;
127 typedef typename TDPol<T>::subobj_stype subobj_stype;
146 bool can_unroll_intset(
const SafePtr<T>& iset)
148 return iset->set_size() <= TIPol::max_set_size_to_unroll();
Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:23
Definition: stdarray.h:18