LIBINT  2.6.0
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
libint2::RecurrenceRelation Class Referenceabstract

RecurrenceRelation describes all recurrence relations. More...

#include <rr.h>

Inheritance diagram for libint2::RecurrenceRelation:
Inheritance graph
[legend]
Collaboration diagram for libint2::RecurrenceRelation:
Collaboration graph
[legend]

Public Types

typedef RecurrenceRelation this_type
 
typedef AlgebraicOperator< DGVertexExprType
 Numerical expression of a recurrence relation is always expressed as an AlgebraicOperator<DGVertex>
 

Public Member Functions

virtual unsigned int num_children () const =0
 num_children() returns the actual number of children. More...
 
virtual SafePtr< DGVertexrr_child (unsigned int i) const =0
 Returns i-th child.
 
virtual SafePtr< DGVertexrr_target () const =0
 Returns the target.
 
const SafePtr< ExprType > & rr_expr () const
 Returns the expression.
 
virtual bool is_simple () const =0
 Returns true is this recurrence relation is simple enough to optimize away. More...
 
virtual bool invariant_type () const
 Returns true is the type of target and all children are exactly the same.
 
virtual int partindex_direction () const
 
virtual BraketDirection braket_direction () const
 
size_t size_of_children () const
 
const std::string & label () const
 label() returns a unique, short, descriptive label of this RR (e.g. More...
 
virtual std::string description () const
 description() returns a verbose description of this RR
 
virtual void generate_code (const SafePtr< CodeContext > &context, const SafePtr< ImplicitDimensions > &dims, const std::string &funcname, std::ostream &decl, std::ostream &def)
 Generate declaration and definition for the recurrence relation.
 
virtual void generate_generic_code (const SafePtr< CodeContext > &context, const SafePtr< ImplicitDimensions > &dims, const std::string &funcname, std::ostream &decl, std::ostream &def)
 Generate declaration and definition for the recurrence relation using generic code (typically, a manually written code)
 
virtual std::string spfunction_call (const SafePtr< CodeContext > &context, const SafePtr< ImplicitDimensions > &dims) const
 Generate a callback for this recurrence relation.
 
unsigned int nflops () const
 Return the number of FLOPs per this recurrence relation.
 
void inst_id (const SingletonStack< RecurrenceRelation, string >::InstanceID &i)
 RecurrenceRelation is managed by SingletonStack but doesn't need to keep track of instance ID.
 

Protected Member Functions

void add_expr (const SafePtr< ExprType > &a, int minus=1)
 Adds a (or -a, if minus = -1) to expr_.
 
virtual std::string generate_label () const =0
 Generates the label.
 
template<class RR >
bool register_with_rrstack ()
 Registers with the stack.
 

Protected Attributes

unsigned int nflops_
 
std::string label_
 
SafePtr< ExprTypeexpr_
 

Detailed Description

RecurrenceRelation describes all recurrence relations.

Member Function Documentation

◆ braket_direction()

virtual BraketDirection libint2::RecurrenceRelation::braket_direction ( ) const
inlinevirtual
Returns
BraketDirection::BraToKet if recurrence relation transfers quanta from function in bra to function in ket, BraketDirection::KetToBra if the transfer is from ket to bra, and BraketDirection::None if neither.

Reimplemented in libint2::HRR< IntType, BFSet, part, loc_a, pos_a, loc_b, pos_b >.

◆ is_simple()

virtual bool libint2::RecurrenceRelation::is_simple ( ) const
pure virtual

Returns true is this recurrence relation is simple enough to optimize away.

As a result of such optimization, standalone function will NOT be generated for this recurrence relation. Instead, it's source will be inlined and optimized.

Implemented in libint2::HRR< IntType, BFSet, part, loc_a, pos_a, loc_b, pos_b >, libint2::ITR_11_TwoPRep_11< ERI, BFSet, part, where >, libint2::IntegralSet_to_Integrals< I >, libint2::GenericRecurrenceRelation< RRImpl, F, Target >, libint2::GenericRecurrenceRelation< VRR_1_Overlap_1_1d< Axis, where >, CGF1d< Axis >, GenIntegralSet_1_1< CGF1d< Axis >, OverlapOper, EmptySet > >, libint2::GenericRecurrenceRelation< VRR_1_SMultipole_1< BFSet, where >, BFSet, GenIntegralSet_1_1< BFSet, SphericalMultipoleOper, EmptySet > >, libint2::GenericRecurrenceRelation< VRR_11_TwoPRep_11< BFSet, part, where >, BFSet, GenIntegralSet_11_11< BFSet, TwoPRep, mType > >, libint2::GenericRecurrenceRelation< VRR_1_Overlap_1< BFSet, where >, BFSet, GenIntegralSet_1_1< BFSet, OverlapOper, EmptySet > >, libint2::GenericRecurrenceRelation< CR_11_DivG12prime_xTx_11< BFSet >, BFSet, GenIntegralSet_11_11< BFSet, DivG12prime_xTx, mType > >, libint2::GenericRecurrenceRelation< CR_11_R12kR12lG12_11< BFSet >, BFSet, GenIntegralSet_11_11< BFSet, R12kR12lG12, EmptySet > >, libint2::GenericRecurrenceRelation< CR_11_G12TiG12_11< BFSet >, BFSet, GenIntegralSet_11_11< BFSet, G12TiG12, mType > >, libint2::GenericRecurrenceRelation< CR_11_TiG12_11< BFSet >, BFSet, GenIntegralSet_11_11< BFSet, TiG12, mType > >, libint2::GenericRecurrenceRelation< CR_XYZ_1_1< F, Oper, AuxQuanta >, F, GenIntegralSet_1_1< F, Oper, AuxQuanta > >, libint2::GenericRecurrenceRelation< CR_DerivGauss< IntType, part, where, trans_inv_part, trans_inv_where >, IntType::BasisFunctionType, IntType >, libint2::GenericRecurrenceRelation< VRR_11_R12kG12_11< BFSet, part, where >, BFSet, GenIntegralSet_11_11< BFSet, R12kG12, mType > >, libint2::GenericRecurrenceRelation< VRR_1_ElecPot_1< BFSet, where >, BFSet, GenIntegralSet_1_1< BFSet, ElecPotOper, mType > >, libint2::GenericRecurrenceRelation< CR_11_GTG_11_1d< Axis >, CGShell1d< Axis >, GenIntegralSet_11_11< CGShell1d< Axis >, GTG_1d, EmptySet > >, libint2::GenericRecurrenceRelation< VRR_1_Kinetic_1< BFSet, where >, BFSet, GenIntegralSet_1_1< BFSet, KineticOper, EmptySet > >, libint2::CR_11_R1dotR1G12_11< I, BFSet >, libint2::CR_11_R1dotR2G12_11< I, BFSet >, libint2::CR_11_R2dotR2G12_11< I, BFSet >, and libint2::Uncontract_Integral< I >.

◆ label()

const std::string & RecurrenceRelation::label ( ) const

label() returns a unique, short, descriptive label of this RR (e.g.

"VRR A (p s | 1/r_{12} | d s )" for Obara-Saika recurrence relation applied to center A to compute (ps|ds) ERI)

References generate_label().

Referenced by description(), generate_code(), libint2::HRR< IntType, BFSet, part, loc_a, pos_a, loc_b, pos_b >::spfunction_call(), and spfunction_call().

◆ num_children()

virtual unsigned int libint2::RecurrenceRelation::num_children ( ) const
pure virtual

num_children() returns the actual number of children.

For example, VRR for ERIs has 5 children on the right-hand side, however, for some ERI classes (ss|ps) the actual number may be smaller.

Implemented in libint2::HRR< IntType, BFSet, part, loc_a, pos_a, loc_b, pos_b >, libint2::ITR_11_TwoPRep_11< ERI, BFSet, part, where >, libint2::IntegralSet_to_Integrals< I >, libint2::GenericRecurrenceRelation< RRImpl, F, Target >, libint2::GenericRecurrenceRelation< VRR_1_Overlap_1_1d< Axis, where >, CGF1d< Axis >, GenIntegralSet_1_1< CGF1d< Axis >, OverlapOper, EmptySet > >, libint2::GenericRecurrenceRelation< VRR_1_SMultipole_1< BFSet, where >, BFSet, GenIntegralSet_1_1< BFSet, SphericalMultipoleOper, EmptySet > >, libint2::GenericRecurrenceRelation< VRR_11_TwoPRep_11< BFSet, part, where >, BFSet, GenIntegralSet_11_11< BFSet, TwoPRep, mType > >, libint2::GenericRecurrenceRelation< VRR_1_Overlap_1< BFSet, where >, BFSet, GenIntegralSet_1_1< BFSet, OverlapOper, EmptySet > >, libint2::GenericRecurrenceRelation< CR_11_DivG12prime_xTx_11< BFSet >, BFSet, GenIntegralSet_11_11< BFSet, DivG12prime_xTx, mType > >, libint2::GenericRecurrenceRelation< CR_11_R12kR12lG12_11< BFSet >, BFSet, GenIntegralSet_11_11< BFSet, R12kR12lG12, EmptySet > >, libint2::GenericRecurrenceRelation< CR_11_G12TiG12_11< BFSet >, BFSet, GenIntegralSet_11_11< BFSet, G12TiG12, mType > >, libint2::GenericRecurrenceRelation< CR_11_TiG12_11< BFSet >, BFSet, GenIntegralSet_11_11< BFSet, TiG12, mType > >, libint2::GenericRecurrenceRelation< CR_XYZ_1_1< F, Oper, AuxQuanta >, F, GenIntegralSet_1_1< F, Oper, AuxQuanta > >, libint2::GenericRecurrenceRelation< CR_DerivGauss< IntType, part, where, trans_inv_part, trans_inv_where >, IntType::BasisFunctionType, IntType >, libint2::GenericRecurrenceRelation< VRR_11_R12kG12_11< BFSet, part, where >, BFSet, GenIntegralSet_11_11< BFSet, R12kG12, mType > >, libint2::GenericRecurrenceRelation< VRR_1_ElecPot_1< BFSet, where >, BFSet, GenIntegralSet_1_1< BFSet, ElecPotOper, mType > >, libint2::GenericRecurrenceRelation< CR_11_GTG_11_1d< Axis >, CGShell1d< Axis >, GenIntegralSet_11_11< CGShell1d< Axis >, GTG_1d, EmptySet > >, libint2::GenericRecurrenceRelation< VRR_1_Kinetic_1< BFSet, where >, BFSet, GenIntegralSet_1_1< BFSet, KineticOper, EmptySet > >, libint2::CR_11_R1dotR1G12_11< I, BFSet >, libint2::CR_11_R1dotR2G12_11< I, BFSet >, libint2::CR_11_R2dotR2G12_11< I, BFSet >, and libint2::Uncontract_Integral< I >.

Referenced by size_of_children(), and spfunction_call().

◆ partindex_direction()

virtual int libint2::RecurrenceRelation::partindex_direction ( ) const
inlinevirtual
Returns
1 if recurrence relation transfers quanta from particle from to particle to where from < to , -1 if from > to , and 0 if neither

Reimplemented in libint2::ITR_11_TwoPRep_11< ERI, BFSet, part, where >.

◆ size_of_children()

size_t RecurrenceRelation::size_of_children ( ) const
Returns
the total size of the children of this RR

References num_children(), and rr_child().


The documentation for this class was generated from the following files: