21 #include <smart_ptr.h> 22 #include <global_macros.h> 24 #ifndef _libint2_src_bin_libint_equiv_h_ 25 #define _libint2_src_bin_libint_equiv_h_ 41 typedef typename T::parent_type
P;
43 static bool equiv(
const T& a,
const T& b) {
47 static bool equiv(
const SafePtr<T>& a,
const SafePtr<T>& b) {
48 return a->operator==(*b.get());
51 static bool equiv(
const T* a,
const SafePtr<T>& b) {
52 return a->operator==(*b.get());
55 static bool equiv(
const SafePtr<T>& b,
const T* a) {
56 return a->operator==(*b.get());
59 static bool equiv(
const T* a,
const T& b) {
60 return a->operator==(b);
63 #if !PTREQUIV_USE_TYPEID 65 static bool equiv(
const SafePtr<T>& a,
const SafePtr<P>& b) {
66 SafePtr<T> b_cast = dynamic_pointer_cast<T,P>(b);
70 return a->operator==(*b_cast.get());
73 static bool equiv(
const T* a,
const SafePtr<P>& b) {
74 SafePtr<T> b_cast = dynamic_pointer_cast<T,P>(b);
78 return a->operator==(*b_cast.get());
81 static bool equiv(
const T* a,
const SafePtr<DGVertex>& b) {
82 SafePtr<T> b_cast = dynamic_pointer_cast<T,DGVertex>(b);
86 return a->operator==(*b_cast.get());
91 static bool equiv(
const SafePtr<T>& a,
const SafePtr<P>& b) {
92 if (a->typeid_ != b->typeid_)
95 SafePtr<T> b_cast = static_pointer_cast<T,P>(b);
96 return a->operator==(*b_cast.get());
100 static bool equiv(
const T* a,
const SafePtr<DGVertex>& b) {
101 if (a->typeid_ != b->typeid_)
104 #if PTREQUIV_USE_KEY_TO_COMPARE 105 #if PTREQUIV_USE_INSTID 106 return a->instid_ == b->instid_;
108 return a->label() == b->label();
111 SafePtr<T> b_cast = static_pointer_cast<T,DGVertex>(b);
112 return a->operator==(*b_cast.get());
Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:24
T::parent_type P
A shortcut for T::parent_type.
Definition: equiv.h:41
PtrEquiv<T> provides a set of comparison functions named 'equiv' which take as arguments a mix of ref...
Definition: equiv.h:36