Skip to content

Commit

Permalink
src/bin/libint/strategy.cc
Browse files Browse the repository at this point in the history
  • Loading branch information
e-kwsm committed Oct 31, 2023
1 parent 5854c5b commit 8a5c7b1
Showing 1 changed file with 46 additions and 46 deletions.
92 changes: 46 additions & 46 deletions src/bin/libint/strategy.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ namespace libint2 {
template <class T> struct MasterStrategy;
#if LIBINT_SHELLQUARTET_STRATEGY == LIBINT_SHELLQUARTET_STRATEGY_A0C0
template <> struct MasterStrategy<TwoPRep_11_11_sq> {
typedef boost::mpl::list<
using value = boost::mpl::list<
HRR_ab_11_TwoPRep_11_sh,
HRR_cd_11_TwoPRep_11_sh,
Deriv_a_11_TwoPRep_11_sh,
Expand All @@ -79,10 +79,10 @@ namespace libint2 {
#endif
VRR_a_11_TwoPRep_11_sh,
VRR_c_11_TwoPRep_11_sh
> value;
>;
};
template <> struct MasterStrategy<TwoPRep_11_11_int> {
typedef boost::mpl::list<
using value = boost::mpl::list<
HRR_ab_11_TwoPRep_11_int,
HRR_cd_11_TwoPRep_11_int,
Deriv_a_11_TwoPRep_11_int,
Expand All @@ -95,11 +95,11 @@ namespace libint2 {
#endif
VRR_a_11_TwoPRep_11_int,
VRR_c_11_TwoPRep_11_int
> value;
>;
};
#else // 0B0D strategy
template <> struct MasterStrategy<TwoPRep_11_11_sq> {
typedef boost::mpl::list<
using value = boost::mpl::list<
HRR_ba_11_TwoPRep_11_sh,
HRR_dc_11_TwoPRep_11_sh,
Deriv_a_11_TwoPRep_11_sh,
Expand All @@ -112,10 +112,10 @@ namespace libint2 {
#endif
VRR_b_11_TwoPRep_11_sh,
VRR_d_11_TwoPRep_11_sh
> value;
>;
};
template <> struct MasterStrategy<TwoPRep_11_11_int> {
typedef boost::mpl::list<
using value = boost::mpl::list<
HRR_ba_11_TwoPRep_11_int,
HRR_dc_11_TwoPRep_11_int,
Deriv_a_11_TwoPRep_11_int,
Expand All @@ -128,52 +128,52 @@ namespace libint2 {
#endif
VRR_b_11_TwoPRep_11_int,
VRR_d_11_TwoPRep_11_int
> value;
>;
};
#endif

#if LIBINT_SHELLQUARTET_STRATEGY == LIBINT_SHELLQUARTET_STRATEGY_A0C0
template <> struct MasterStrategy<R12kG12_11_11_sq> {
typedef boost::mpl::list<
using value = boost::mpl::list<
HRR_ab_11_R12kG12_11_sh,
HRR_cd_11_R12kG12_11_sh,
VRR_a_11_R12kG12_11_sh,
VRR_c_11_R12kG12_11_sh
> value;
>;
};
template <> struct MasterStrategy<R12kG12_11_11_int> {
typedef boost::mpl::list<
using value = boost::mpl::list<
HRR_ab_11_R12kG12_11_int,
HRR_cd_11_R12kG12_11_int,
VRR_a_11_R12kG12_11_int,
VRR_c_11_R12kG12_11_int
> value;
>;
};
#else // 0B0D strategy
template <> struct MasterStrategy<R12kG12_11_11_sq> {
typedef boost::mpl::list<
using value = boost::mpl::list<
HRR_ba_11_R12kG12_11_sh,
HRR_dc_11_R12kG12_11_sh,
VRR_b_11_R12kG12_11_sh,
VRR_d_11_R12kG12_11_sh
> value;
>;
};
template <> struct MasterStrategy<R12kG12_11_11_int> {
typedef boost::mpl::list<
using value = boost::mpl::list<
HRR_ba_11_R12kG12_11_int,
HRR_dc_11_R12kG12_11_int,
VRR_b_11_R12kG12_11_int,
VRR_d_11_R12kG12_11_int
> value;
>;
};
#endif

template <> struct MasterStrategy<R12kR12lG12_11_11_sq> {
typedef boost::mpl::list<
using value = boost::mpl::list<
HRR_ab_11_R12kR12lG12_11_sh,
HRR_cd_11_R12kR12lG12_11_sh,
CR_11_R12kR12lG12_11_sh
> value;
>;
};
template <> struct MasterStrategy<R12kR12lG12_11_11_int> {
typedef boost::mpl::list<
Expand All @@ -183,80 +183,80 @@ namespace libint2 {
> value;
};
template <> struct MasterStrategy<TiG12_11_11_sq> {
typedef boost::mpl::list<
using value = boost::mpl::list<
HRR_ab_11_TiG12_11_sh,
HRR_cd_11_TiG12_11_sh,
CR_11_TiG12_11_sh
> value;
>;
};
template <> struct MasterStrategy<TiG12_11_11_int> {
typedef boost::mpl::list<
using value = boost::mpl::list<
HRR_ab_11_TiG12_11_int,
HRR_cd_11_TiG12_11_int,
CR_11_TiG12_11_int
> value;
>;
};
template <> struct MasterStrategy<G12TiG12_11_11_sq> {
typedef boost::mpl::list<
using value = boost::mpl::list<
HRR_ab_11_G12TiG12_11_sh,
HRR_cd_11_G12TiG12_11_sh,
CR_11_G12TiG12_11_sh
> value;
>;
};
template <> struct MasterStrategy<G12TiG12_11_11_int> {
typedef boost::mpl::list<
using value = boost::mpl::list<
HRR_ab_11_G12TiG12_11_int,
HRR_cd_11_G12TiG12_11_int,
CR_11_G12TiG12_11_int
> value;
>;
};
template <> struct MasterStrategy<DivG12prime_xTx_11_11_sq> {
typedef boost::mpl::list<
using value = boost::mpl::list<
HRR_ab_11_DivG12prime_xTx_sh,
HRR_cd_11_DivG12prime_xTx_sh,
CR_11_DivG12prime_xTx_11_sh
> value;
>;
};
template <> struct MasterStrategy<DivG12prime_xTx_11_11_int> {
typedef boost::mpl::list<
using value = boost::mpl::list<
HRR_ab_11_DivG12prime_xTx_int,
HRR_cd_11_DivG12prime_xTx_int,
CR_11_DivG12prime_xTx_11_int
> value;
>;
};
#if LIBINT_SHELLQUARTET_STRATEGY == LIBINT_SHELLQUARTET_STRATEGY_A0C0
template <> struct MasterStrategy<DummySymmIntegral_11_11_sq> {
typedef boost::mpl::list<
using value = boost::mpl::list<
HRR_ab_11_Dummy_11_sh,
HRR_cd_11_Dummy_11_sh
> value;
>;
};
template <> struct MasterStrategy<DummySymmIntegral_11_11_int> {
typedef boost::mpl::list<
using value = boost::mpl::list<
HRR_ab_11_Dummy_11_int,
HRR_cd_11_Dummy_11_int
> value;
>;
};
#else // 0B0D strategy
template <> struct MasterStrategy<DummySymmIntegral_11_11_sq> {
typedef boost::mpl::list<
using value = boost::mpl::list<
HRR_ba_11_Dummy_11_sh,
HRR_dc_11_Dummy_11_sh
> value;
>;
};
template <> struct MasterStrategy<DummySymmIntegral_11_11_int> {
typedef boost::mpl::list<
using value = boost::mpl::list<
HRR_ba_11_Dummy_11_int,
HRR_dc_11_Dummy_11_int
> value;
>;
};
#endif

#if LIBINT_SUPPORT_ONEBODYINTS
template <> struct MasterStrategy<Overlap_1_1_sh_x> {
typedef boost::mpl::list<
using value = boost::mpl::list<
CR_XYZ_1_1<CGShell1d<CartesianAxis_X>,OverlapOper>
> value;
>;
};
template <> struct MasterStrategy<Overlap_1_1_sh_y> {
typedef boost::mpl::list<
Expand Down Expand Up @@ -384,15 +384,15 @@ namespace libint2 {
#endif // LIBINT_SUPPORT_ONEBODYINTS

template <typename T> struct MasterStrategy {
typedef boost::mpl::list<> value;
using value = boost::mpl::list<>;
};

/// transform<RRType> encapsulates RRType and the action associated with RRType
/// it's used by apply_strategy::operator()<RRType> via mpl::for_each
template <class RRType>
class apply_strategy_transform {
public:
typedef typename RRType::TargetType IntType;
using IntType = typename RRType::TargetType;
// return true if no more visitations necessary
static bool visit(const SafePtr<DirectedGraph>& dg,
const SafePtr<IntType>& integral,
Expand Down Expand Up @@ -544,7 +544,7 @@ namespace libint2 {
if (can_unroll && can_uncontract) {
#endif
if (can_unroll) {
typedef IntegralSet_to_Integrals<T> ISet2I;
using ISet2I = IntegralSet_to_Integrals<T>;
SafePtr<ISet2I> x(new ISet2I(tptr));
rr = static_pointer_cast<RecurrenceRelation,ISet2I>(x);
#if DEBUG
Expand All @@ -555,7 +555,7 @@ namespace libint2 {
// if allowed to uncontract -- try that first
const bool can_uncontract = dg->registry()->uncontract();
if (can_uncontract) {
typedef Uncontract_Integral<T> UncI;
using UncI = Uncontract_Integral<T>;
SafePtr<UncI> x(new UncI(tptr));
rr = static_pointer_cast<RecurrenceRelation,UncI>(x);
if (rr != 0) {
Expand All @@ -569,8 +569,8 @@ namespace libint2 {
}

// if uncontraction failed -- apply the known strategy
typedef apply_strategy<T> apply_strategy_t;
typedef typename apply_strategy_t::Impl apply_strategy_t_impl;
using apply_strategy_t = apply_strategy<T>;
using apply_strategy_t_impl = typename apply_strategy_t::Impl;
SafePtr<apply_strategy_t_impl> applier_impl(new apply_strategy_t_impl(dg,tptr,tactic));
apply_strategy_t applier(applier_impl);
mpl::for_each<typename MasterStrategy<T>::value, apply_strategy_transform<_1>, apply_strategy_t& >(applier);
Expand Down

0 comments on commit 8a5c7b1

Please sign in to comment.