20 #include <smart_ptr.h> 21 #include <global_macros.h> 23 #ifndef _libint2_src_bin_libint_equiv_h_ 24 #define _libint2_src_bin_libint_equiv_h_ 40 typedef typename T::parent_type
P;
42 static bool equiv(
const T& a,
const T& b) {
46 static bool equiv(
const SafePtr<T>& a,
const SafePtr<T>& b) {
47 return a->operator==(*b.get());
50 static bool equiv(
const T* a,
const SafePtr<T>& b) {
51 return a->operator==(*b.get());
54 static bool equiv(
const SafePtr<T>& b,
const T* a) {
55 return a->operator==(*b.get());
58 static bool equiv(
const T* a,
const T& b) {
59 return a->operator==(b);
62 #if !PTREQUIV_USE_TYPEID 64 static bool equiv(
const SafePtr<T>& a,
const SafePtr<P>& b) {
65 SafePtr<T> b_cast = dynamic_pointer_cast<T,P>(b);
69 return a->operator==(*b_cast.get());
72 static bool equiv(
const T* a,
const SafePtr<P>& b) {
73 SafePtr<T> b_cast = dynamic_pointer_cast<T,P>(b);
77 return a->operator==(*b_cast.get());
80 static bool equiv(
const T* a,
const SafePtr<DGVertex>& b) {
81 SafePtr<T> b_cast = dynamic_pointer_cast<T,
DGVertex>(b);
85 return a->operator==(*b_cast.get());
90 static bool equiv(
const SafePtr<T>& a,
const SafePtr<P>& b) {
91 if (a->typeid_ != b->typeid_)
94 SafePtr<T> b_cast = static_pointer_cast<T,P>(b);
95 return a->operator==(*b_cast.get());
99 static bool equiv(
const T* a,
const SafePtr<DGVertex>& b) {
100 if (a->typeid_ != b->typeid_)
103 #if PTREQUIV_USE_KEY_TO_COMPARE 104 #if PTREQUIV_USE_INSTID 105 return a->instid_ == b->instid_;
107 return a->label() == b->label();
110 SafePtr<T> b_cast = static_pointer_cast<T,
DGVertex>(b);
111 return a->operator==(*b_cast.get());
Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:23
This is a vertex of a Directed Graph (DG)
Definition: dgvertex.h:42
T::parent_type P
A shortcut for T::parent_type.
Definition: equiv.h:40
PtrEquiv<T> provides a set of comparison functions named 'equiv' which take as arguments a mix of ref...
Definition: equiv.h:35