LIBINT 2.9.0
Public Types | Public Member Functions | List of all members
libint2::AlgebraicOperator< T > Class Template Reference

AlgebraicOperator is an algebraic operator that acts on objects of type T. More...

#include <algebra.h>

Inheritance diagram for libint2::AlgebraicOperator< T >:
Inheritance graph
[legend]
Collaboration diagram for libint2::AlgebraicOperator< T >:
Collaboration graph
[legend]

Public Types

typedef algebra::OperatorTypes OperatorTypes
 
typedef algebra::OperatorTypes::OperatorType OperatorType
 
- Public Types inherited from libint2::DGVertex
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< AddressAddressNotSet
 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< std::shared_ptr< DGArc > > ArcSetType
 ArcSetType is a container used to maintain entry and exit arcs.
 
- Public Types inherited from libint2::Hashable< KeyTypes::InstanceID, ComputeKey >
typedef KeyTraits< KeyTypes::InstanceID >::ReturnType KeyReturnType
 

Public Member Functions

 AlgebraicOperator (OperatorType OT, const std::shared_ptr< T > &left, const std::shared_ptr< T > &right)
 
 AlgebraicOperator (const std::shared_ptr< AlgebraicOperator > &A, const std::shared_ptr< T > &left, const std::shared_ptr< T > &right)
 Clone A but replace operands with left and right.
 
OperatorType type () const
 Returns the OperatorType.
 
const std::shared_ptr< T > & left () const
 Returns the left argument.
 
const std::shared_ptr< T > & right () const
 Returns the right argument.
 
void add_exit_arc (const std::shared_ptr< DGArc > &a) override
 Overloads DGVertex::add_exit_arc().
 
unsigned int size () const override
 Implements DGVertex::size()
 
bool equiv (const std::shared_ptr< DGVertex > &a) const override
 Implements DGVertex::equiv()
 
bool operator== (const std::shared_ptr< AlgebraicOperator > &a) const
 laboriously compare 2 operators element by element
 
const std::string & label () const override
 Implements DGVertex::label()
 
const std::string & id () const override
 Implements DGVertex::id()
 
std::string description () const override
 Implements DGVertex::description()
 
void del_exit_arcs () override
 Overloads DGVertex::del_exit_arcs()
 
DGVertex::KeyReturnType key () const override
 Implements Hashable::key()
 
void print (std::ostream &os) const override
 print(os) prints vertex info to os
 
void add_exit_arc (const std::shared_ptr< DGArc > &a)
 add_exit_arc(arc) adds arc as an arc connecting to children of this vertex.
 
- Public Member Functions inherited from libint2::DGVertex
 DGVertex (ClassID tid)
 Sets typeid to tid.
 
 DGVertex (ClassID tid, const std::vector< std::shared_ptr< DGArc > > &parents, const std::vector< std::shared_ptr< 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
 
void replace_exit_arc (const std::shared_ptr< DGArc > &A, const std::shared_ptr< DGArc > &B)
 replace_exit_arc() replaces A with B.
 
void detach ()
 this function detaches the vertex from other vertices.
 
const ArcSetTypeexit_arcs () const
 
const ArcSetTypeentry_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 std::shared_ptr< DGArc > & exit_arc (const std::shared_ptr< DGVertex > &v) const
 return arc connecting this to v, otherwise null pointer
 
bool precomputed () const
 precomputed() returns whether this DGVertex is precomputed.
 
const DirectedGraphdg () 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.
 
const std::string & graph_label () const
 returns the label used for this vertex when visualizing graph.
 
void set_graph_label (const std::string &graph_label)
 sets the graph label
 
const std::shared_ptr< DRTree > & subtree () const
 Returns the subtree to which this vertex belongs.
 
void refer_this_to (const std::shared_ptr< 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.
 
Address address () const
 returns the address of this quantity on Libint's stack.
 
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.
 
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
 
std::shared_ptr< DGVertexpostcalc () const
 Returns pointer to vertex to be computed after this vertex, 0 if this is the last vertex.
 
void set_postcalc (const std::shared_ptr< 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.
 

Additional Inherited Members

- Public Attributes inherited from libint2::DGVertex
ClassID typeid_
 typeid stores the ClassID of the concrete type.
 
InstanceID instid_
 instid stores the InstanceID of the object.
 
- Protected Attributes inherited from libint2::Hashable< KeyTypes::InstanceID, ComputeKey >
KeyStore< KeyTypes::InstanceID, OwnKey< KeyMP >::result > key_
 

Detailed Description

template<class T>
class libint2::AlgebraicOperator< T >

AlgebraicOperator is an algebraic operator that acts on objects of type T.

An algebraic operator has 2 arguments, to the left and to the right ( L oper R ).

Member Function Documentation

◆ add_exit_arc() [1/2]

void libint2::AlgebraicOperator< DGVertex >::add_exit_arc ( const std::shared_ptr< DGArc > & arc)
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 from libint2::DGVertex.

References libint2::DGVertex::add_exit_arc().

◆ add_exit_arc() [2/2]

template<class T >
void libint2::AlgebraicOperator< T >::add_exit_arc ( const std::shared_ptr< DGArc > & a)
overridevirtual

Overloads DGVertex::add_exit_arc().

The default definition is used unless T = DGVertex (see algebra.cc)

Reimplemented from libint2::DGVertex.

◆ del_exit_arcs()

template<class T >
void libint2::AlgebraicOperator< T >::del_exit_arcs ( )
inlineoverridevirtual

Overloads DGVertex::del_exit_arcs()

Reimplemented from libint2::DGVertex.

◆ description()

template<class T >
std::string libint2::AlgebraicOperator< T >::description ( ) const
inlineoverridevirtual

◆ equiv()

template<class T >
bool libint2::AlgebraicOperator< T >::equiv ( const std::shared_ptr< DGVertex > & a) const
inlineoverridevirtual

◆ id()

template<class T >
const std::string & libint2::AlgebraicOperator< T >::id ( ) const
inlineoverridevirtual

◆ key()

template<class T >
DGVertex::KeyReturnType libint2::AlgebraicOperator< T >::key ( ) const
inlineoverridevirtual

Implements Hashable::key()

Implements libint2::DGVertex.

Referenced by libint2::AlgebraicOperator< T >::equiv().

◆ label()

template<class T >
const std::string & libint2::AlgebraicOperator< T >::label ( ) const
inlineoverridevirtual

◆ print()

template<class T >
void libint2::AlgebraicOperator< T >::print ( std::ostream & os) const
inlineoverridevirtual

print(os) prints vertex info to os

Reimplemented from libint2::DGVertex.

References libint2::DGVertex::print().

◆ size()

template<class T >
unsigned int libint2::AlgebraicOperator< T >::size ( ) const
inlineoverridevirtual

Implements DGVertex::size()

Implements libint2::DGVertex.


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