LIBINT
2.6.0
|
This is a vertex of a Directed Graph (DG) More...
#include <dgvertex.h>
Public Types | |
typedef MemoryManager::Address | Address |
The address on the stack during computation is described using this type. | |
typedef MemoryManager::Size | Size |
The size of a block the stack during computation is described using this type. | |
typedef NotSet< Address > | AddressNotSet |
Exception thrown if address is not set. | |
typedef NotSet< std::string > | GraphLabelNotSet |
Exception thrown if graph label is not set. | |
typedef NotSet< std::string > | SymbolNotSet |
Exception thrown if code symbol is not set. | |
typedef KeyTypes::ClassID | ClassID |
Type identifier. | |
typedef KeyTypes::InstanceID | InstanceID |
Instance identifier. | |
typedef KeyTypes::InstanceID | KeyType |
DGVertex provides function key() which computes key of type KeyType and returns it using KeyReturnType. | |
typedef Hashable< KeyType, ComputeKey >::KeyReturnType | KeyReturnType |
typedef std::list< SafePtr< DGArc > > | ArcSetType |
ArcSetType is a container used to maintain entry and exit arcs. | |
![]() | |
typedef KeyTraits< KeyTypes::InstanceID >::ReturnType | KeyReturnType |
Public Member Functions | |
DGVertex (ClassID tid) | |
Sets typeid to tid. | |
DGVertex (ClassID tid, const std::vector< SafePtr< DGArc > > &parents, const std::vector< SafePtr< DGArc > > &children) | |
Sets typeid to tid. | |
DGVertex (const DGVertex &v) | |
This is a copy constructor. | |
void | make_a_target () |
make_a_target() marks this vertex as a target | |
bool | is_a_target () const |
is_a_target() returns true if this vertex is a target | |
virtual void | add_exit_arc (const SafePtr< DGArc > &) |
add_exit_arc(arc) adds arc as an arc connecting to children of this vertex. More... | |
virtual void | del_exit_arcs () |
del_exit_arcs() removes all exit arcs from this and corresponding children vertices. More... | |
void | replace_exit_arc (const SafePtr< DGArc > &A, const SafePtr< DGArc > &B) |
replace_exit_arc() replaces A with B. More... | |
void | detach () |
this function detaches the vertex from other vertices. More... | |
const ArcSetType & | exit_arcs () const |
const ArcSetType & | entry_arcs () const |
unsigned int | num_entry_arcs () const |
returns the number of parents | |
ArcSetType::const_iterator | first_entry_arc () const |
returns parents::begin() | |
ArcSetType::const_iterator | plast_entry_arc () const |
returns parents::end() | |
unsigned int | num_exit_arcs () const |
returns the number of children | |
ArcSetType::const_iterator | first_exit_arc () const |
returns children::begin() | |
ArcSetType::const_iterator | plast_exit_arc () const |
returns children::end() | |
const SafePtr< DGArc > & | exit_arc (const SafePtr< DGVertex > &v) const |
return arc connecting this to v, otherwise null pointer | |
virtual KeyReturnType | key () const =0 |
computes key | |
virtual bool | equiv (const SafePtr< DGVertex > &) const =0 |
equiv(const DGVertex* aVertex) returns true if this vertex is equivalent to *aVertex. | |
bool | precomputed () const |
precomputed() returns whether this DGVertex is precomputed. More... | |
virtual unsigned int | size () const =0 |
Returns the amount of memory (in floating-point words) to be allocated for the vertex. | |
virtual const std::string & | label () const =0 |
label() returns a unique, short, descriptive label of DGVertex (e.g. More... | |
virtual const std::string & | id () const =0 |
id() returns a very short label of DGVertex which is (almost) guaranteed to be a symbol (e.g. More... | |
virtual std::string | description () const =0 |
description() returns a full, human-readable description of DGVertex (e.g. More... | |
virtual void | print (std::ostream &os) const |
print(os) prints vertex info to os | |
const DirectedGraph * | dg () const |
Returns pointer to the DirectedGraph to which this DGVertex belongs to. | |
void | dg (const DirectedGraph *d) |
Sets pointer to the DirectedGraph to which this DGVertex belongs to. Should be used with utmost caution. | |
const std::string & | graph_label () const |
returns the label used for this vertex when visualizing graph. can throw GraphLabelNotSet. | |
void | set_graph_label (const std::string &graph_label) |
sets the graph label | |
const SafePtr< DRTree > & | subtree () const |
Returns the subtree to which this vertex belongs. | |
void | refer_this_to (const SafePtr< DGVertex > &V) |
refer_this_to(V) makes this vertex act like a reference to V so that calls to symbol() and address() report code symbol and stack address of V | |
bool | refers_to_another () const |
refers to another vertex? | |
const std::string & | symbol () const |
returns the code symbol. can throw SymbolNotSet | |
void | set_symbol (const std::string &symbol) |
sets the code symbol | |
bool | symbol_set () const |
returns true if the symbol has been set | |
void | reset_symbol () |
this function void the symbol, i.e. it is no longer set after calling this member | |
Address | address () const |
returns the address of this quantity on Libint's stack. can throw AddressNotSet | |
void | set_address (const Address &address) |
sets the address of this quantity on Libint's stack | |
bool | address_set () const |
returns true if the address has been set | |
void | need_to_compute (bool ntc) |
indicates whether this vertex needs to be computed. More... | |
void | not_need_to_compute () |
shortcut to need_to_compute(false) | |
bool | need_to_compute () const |
returns true if this index needs to be computed. | |
bool | declared () const |
void | declared (bool d) |
void | prepare_to_traverse () |
prepare_to_traverse() must be called before traversal of the graph starts | |
unsigned int | tag () |
tag() tags the vertex and returns the total number of tags this vertex has received | |
void | schedule () |
schedule() marks the vertex as scheduled, hence its code exists | |
bool | scheduled () const |
scheduled() returns true if the vertex has been scheduled | |
SafePtr< DGVertex > | postcalc () const |
Returns pointer to vertex to be computed after this vertex, 0 if this is the last vertex. | |
void | set_postcalc (const SafePtr< DGVertex > &postcalc) |
Sets postcalc. | |
void | reset () |
Resets the vertex, releasing all arcs. | |
virtual void | unregister () const |
If vertex is a singleton then remove it from the SingletonManager. Must be reimplemented in derived singleton class. | |
virtual bool | this_precomputed () const =0 |
this_precomputed() is used by precomputed() to determine whether this object really is precomputed. More... | |
Public Attributes | |
ClassID | typeid_ |
typeid stores the ClassID of the concrete type. More... | |
InstanceID | instid_ |
instid stores the InstanceID of the object. More... | |
Friends | |
void | DRTree::add_vertex (const SafePtr< DGVertex > &vertex) |
Only DRTree::set_subtree and DRTree::detach_from can change subtree_. | |
void | DRTree::detach_from (const SafePtr< DGVertex > &v) |
Additional Inherited Members | |
![]() | |
KeyStore< KeyTypes::InstanceID, OwnKey< KeyMP >::result > | key_ |
This is a vertex of a Directed Graph (DG)
|
virtual |
add_exit_arc(arc) adds arc as an arc connecting to children of this vertex.
Thus, arcs are owned by their PARENTS. This function is virtual because certain types of vertices have duplicate references to children in their definition (such as AlgebraicOperator). Such DGVertices need to update their private members.
Reimplemented in libint2::AlgebraicOperator< T >, and libint2::AlgebraicOperator< T >.
Referenced by libint2::AlgebraicOperator< T >::add_exit_arc().
|
virtual |
del_exit_arcs() removes all exit arcs from this and corresponding children vertices.
See documentation for del_exit_arc().
Reimplemented in libint2::AlgebraicOperator< T >.
References num_exit_arcs().
Referenced by detach().
|
pure virtual |
description() returns a full, human-readable description of DGVertex (e.g.
"This is a ( p_x s | 1/r_{12} | d_xy s )^{(1)} integral"). returned by value since not guaranteed to be cached.
Implemented in libint2::CTimeEntity< T >, libint2::AlgebraicOperator< T >, libint2::RTimeEntity< T >, libint2::GenIntegralSet< Oper, BFS, BraSetType, KetSetType, AuxQuanta >, libint2::GenIntegralSet< R1dotR1_G12, IncableBFSet, DefaultTwoPBraket< BFS >::Result, DefaultTwoPBraket< BFS >::Result, EmptySet >, libint2::GenIntegralSet< R2dotR2_G12, IncableBFSet, DefaultTwoPBraket< BFS >::Result, DefaultTwoPBraket< BFS >::Result, EmptySet >, libint2::GenIntegralSet< Oper, IncableBFSet, DefaultOnePBraket< BFS >::Result, DefaultOnePBraket< BFS >::Result, AuxQuanta >, libint2::GenIntegralSet< Oper, IncableBFSet, DefaultTwoPBraket< BFS >::Result, DefaultTwoPBraket< BFS >::Result, AuxQuanta >, and libint2::GenIntegralSet< R1dotR2_G12, IncableBFSet, DefaultTwoPBraket< BFS >::Result, DefaultTwoPBraket< BFS >::Result, EmptySet >.
Referenced by refer_this_to(), set_symbol(), and symbol().
void DGVertex::detach | ( | ) |
this function detaches the vertex from other vertices.
It cannot safely remove entry arcs, so the user must previously delete or replace them (see documentation for del_exit_arc()). can throw CannotPerformOperation.
References del_exit_arcs(), and num_entry_arcs().
|
pure virtual |
id() returns a very short label of DGVertex which is (almost) guaranteed to be a symbol (e.g.
"(p_x s|d_xy s)^1")
Implemented in libint2::CTimeEntity< T >, libint2::AlgebraicOperator< T >, libint2::RTimeEntity< T >, libint2::GenIntegralSet< Oper, BFS, BraSetType, KetSetType, AuxQuanta >, libint2::GenIntegralSet< R1dotR1_G12, IncableBFSet, DefaultTwoPBraket< BFS >::Result, DefaultTwoPBraket< BFS >::Result, EmptySet >, libint2::GenIntegralSet< R2dotR2_G12, IncableBFSet, DefaultTwoPBraket< BFS >::Result, DefaultTwoPBraket< BFS >::Result, EmptySet >, libint2::GenIntegralSet< Oper, IncableBFSet, DefaultOnePBraket< BFS >::Result, DefaultOnePBraket< BFS >::Result, AuxQuanta >, libint2::GenIntegralSet< Oper, IncableBFSet, DefaultTwoPBraket< BFS >::Result, DefaultTwoPBraket< BFS >::Result, AuxQuanta >, and libint2::GenIntegralSet< R1dotR2_G12, IncableBFSet, DefaultTwoPBraket< BFS >::Result, DefaultTwoPBraket< BFS >::Result, EmptySet >.
|
pure virtual |
label() returns a unique, short, descriptive label of DGVertex (e.g.
"( p_x s | 1/r_{12} | d_xy s )^{(1)}")
Implemented in libint2::CTimeEntity< T >, libint2::AlgebraicOperator< T >, libint2::RTimeEntity< T >, libint2::GenIntegralSet< Oper, BFS, BraSetType, KetSetType, AuxQuanta >, libint2::GenIntegralSet< R1dotR1_G12, IncableBFSet, DefaultTwoPBraket< BFS >::Result, DefaultTwoPBraket< BFS >::Result, EmptySet >, libint2::GenIntegralSet< R2dotR2_G12, IncableBFSet, DefaultTwoPBraket< BFS >::Result, DefaultTwoPBraket< BFS >::Result, EmptySet >, libint2::GenIntegralSet< Oper, IncableBFSet, DefaultOnePBraket< BFS >::Result, DefaultOnePBraket< BFS >::Result, AuxQuanta >, libint2::GenIntegralSet< Oper, IncableBFSet, DefaultTwoPBraket< BFS >::Result, DefaultTwoPBraket< BFS >::Result, AuxQuanta >, libint2::GenIntegralSet< R1dotR2_G12, IncableBFSet, DefaultTwoPBraket< BFS >::Result, DefaultTwoPBraket< BFS >::Result, EmptySet >, libint2::R1dotR2G12_11_11< BFS >, libint2::R1dotR1G12_11_11< BFS >, and libint2::R2dotR2G12_11_11< BFS >.
Referenced by libint2::DirectedGraph::append_vertex(), print(), and set_graph_label().
void DGVertex::need_to_compute | ( | bool | ntc | ) |
indicates whether this vertex needs to be computed.
Even if this vertex is not precomputed, it may not be desired to compute it. By default, all vertices need to be computed.
Referenced by need_to_compute().
bool DGVertex::precomputed | ( | ) | const |
precomputed() returns whether this DGVertex is precomputed.
See this_precomputed() for description.
References precomputed(), and this_precomputed().
Referenced by precomputed(), and print().
replace_exit_arc() replaces A with B.
See documentation for del_exit_arc().
|
pure virtual |
this_precomputed() is used by precomputed() to determine whether this object really is precomputed.
E.g. (ss|ss) shell is considered not precomputed, i.e. this_precomputed() will return false. But the (ss|ss) integral is considered precomputed. Usually the shell vertex will refer to the integral vertex. Thus calling precomputed() on it will return true.
Implemented in libint2::GenIntegralSet< Oper, BFS, BraSetType, KetSetType, AuxQuanta >, libint2::GenIntegralSet< R1dotR1_G12, IncableBFSet, DefaultTwoPBraket< BFS >::Result, DefaultTwoPBraket< BFS >::Result, EmptySet >, libint2::GenIntegralSet< R2dotR2_G12, IncableBFSet, DefaultTwoPBraket< BFS >::Result, DefaultTwoPBraket< BFS >::Result, EmptySet >, libint2::GenIntegralSet< Oper, IncableBFSet, DefaultOnePBraket< BFS >::Result, DefaultOnePBraket< BFS >::Result, AuxQuanta >, libint2::GenIntegralSet< Oper, IncableBFSet, DefaultTwoPBraket< BFS >::Result, DefaultTwoPBraket< BFS >::Result, AuxQuanta >, and libint2::GenIntegralSet< R1dotR2_G12, IncableBFSet, DefaultTwoPBraket< BFS >::Result, DefaultTwoPBraket< BFS >::Result, EmptySet >.
Referenced by precomputed().
InstanceID libint2::DGVertex::instid_ |
instid stores the InstanceID of the object.
Only makes sense for Singletons. For other objects it's zero. Can be used to compare objects quickly.
ClassID libint2::DGVertex::typeid_ |
typeid stores the ClassID of the concrete type.
It is used to check quickly whether 2 DGVertices are of the same type. Dynamic casts are too expensive.
Referenced by libint2::AlgebraicOperator< T >::equiv(), libint2::RTimeEntity< T >::equiv(), and libint2::CTimeEntity< T >::equiv().