21 #ifndef _libint2_src_bin_libint_cr11r1dotr2g1211_h_ 22 #define _libint2_src_bin_libint_cr11r1dotr2g1211_h_ 34 #include <r1dotr2g12_11_11.h> 37 #include <prefactors.h> 39 #include <default_params.h> 50 template <
template <
typename,
typename,
typename>
class I,
class BFSet>
58 typedef I<BFSet,R1dotR2_G12,EmptySet> TargetType;
66 static SafePtr<ThisType> Instance(
const SafePtr<TargetType>&);
72 SafePtr<TargetType>
target()
const {
return target_; };
74 SafePtr<ChildType> child(
unsigned int i)
const;
76 SafePtr<DGVertex>
rr_target()
const {
return static_pointer_cast<DGVertex,TargetType>(target()); }
78 SafePtr<DGVertex>
rr_child(
unsigned int i)
const {
return dynamic_pointer_cast<DGVertex,ChildType>(child(i)); }
93 bool register_with_rrstack()
const;
97 static const unsigned int max_nchildren_ = 18;
98 SafePtr<TargetType> target_;
99 SafePtr<ChildType> children_[max_nchildren_];
100 unsigned int nchildren_;
102 std::string generate_label()
const 105 os <<
"RR ( " << rr_target()->label() <<
" )";
112 template <
template <
typename,
typename,
typename>
class I,
class F>
113 SafePtr< CR_11_R1dotR2G12_11<I,F> >
116 SafePtr<ThisType> this_ptr(
new ThisType(Tint));
118 if (this_ptr->num_children() != 0) {
119 this_ptr->register_with_rrstack<
ThisType>();
122 return SafePtr<ThisType>();
125 template <
template <
typename,
typename,
typename>
class I,
class F>
127 ParentType(), target_(Tint), nchildren_(0)
129 F sh_a(Tint->bra(0,0));
130 F sh_b(Tint->ket(0,0));
131 F sh_c(Tint->bra(1,0));
132 F sh_d(Tint->ket(1,0));
141 vector<F>* bra_ref = &bra;
142 vector<F>* ket_ref = &ket;
144 const unsigned int ndirs =
is_simple() ? 3 : 1;
145 for(
int xyz=0; xyz<ndirs; xyz++) {
148 bra_ref->operator[](0).inc(xyz);
149 bra_ref->operator[](1).inc(xyz);
150 int next_child = nchildren_;
151 children_[next_child] = ChildType::Instance(bra[0],ket[0],bra[1],ket[1],0);
155 SafePtr<ExprType> expr0_ptr(
new ExprType(ExprType::OperatorTypes::Times,Scalar(1.0),
rr_child(next_child)));
159 bra_ref->operator[](0).dec(xyz);
160 bra_ref->operator[](1).dec(xyz);
164 template <
template <
typename,
typename,
typename>
class I,
class F>
165 SafePtr< typename CR_11_R1dotR2G12_11<I,F>::ChildType >
168 assert(i>=0 && i<nchildren_);
170 for(
int c=0; c<max_nchildren_; c++) {
171 if (children_[c] != 0) {
181 typedef CR_11_R1dotR2G12_11<GenIntegralSet_11_11,CGF> CR_11_R1dotR2G12_11_int;
SafePtr< DGVertex > rr_child(unsigned int i) const
Implementation of RecurrenceRelation::rr_child()
Definition: comp_11_r1dotr2g12_11.h:78
TrivialBFSet<T> defines static member result, which is true if T is a basis function set consisting o...
Definition: bfset.h:892
CR_11_R1dotR2G12_11< GenIntegralSet_11_11, CGShell > CR_11_R1dotR2G12_11_sq
Useful typedefs.
Definition: comp_11_r1dotr2g12_11.h:177
void add_expr(const SafePtr< ExprType > &a, int minus=1)
Adds a (or -a, if minus = -1) to expr_.
Definition: rr.cc:306
Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:24
unsigned int num_children() const
Implementation of RecurrenceRelation::num_children()
Definition: comp_11_r1dotr2g12_11.h:70
SafePtr< DGVertex > rr_target() const
Implementation of RecurrenceRelation::rr_target()
Definition: comp_11_r1dotr2g12_11.h:76
RecurrenceRelation::ExprType ExprType
The type of expressions in which RecurrenceRelations result.
Definition: comp_11_r1dotr2g12_11.h:61
Compute relation for 2-e integrals of the r1.r2 x G12 operators.
Definition: comp_11_r1dotr2g12_11.h:51
AlgebraicOperator is an algebraic operator that acts on objects of type T.
Definition: algebra.h:48
bool is_simple() const
Implementation of RecurrenceRelation::is_simple()
Definition: comp_11_r1dotr2g12_11.h:80
RecurrenceRelation describes all recurrence relations.
Definition: rr.h:101
Set of basis functions.
Definition: bfset.h:42
SafePtr< ChildType > child(unsigned int i) const
child(i) returns pointer to the i-th child
Definition: comp_11_r1dotr2g12_11.h:166
SafePtr< TargetType > target() const
target() returns pointer to the i-th child
Definition: comp_11_r1dotr2g12_11.h:72
Definition: integral_decl.h:38