20 #ifndef _libint2_src_bin_libint_key_h_ 21 #define _libint2_src_bin_libint_key_h_ 23 #include <libint2/intrinsic_types.h> 31 template <
typename T,
typename I>
41 const Type& type()
const {
return t_; }
42 const Instance& instance()
const {
return i_; }
48 static Type invalid_type_;
49 static Instance invalid_instance_;
55 template <
typename T,
typename I>
58 return a.type() == b.type() && a.instance() == b.instance();
61 template <
typename T,
typename I>
62 bool operator<(const TypeAndInstance<T,I>& a,
65 (a.type() < b.type()) ||
66 ( (a.type() == b.type()) &&
67 (a.instance() < b.instance())
84 template <
typename Target,
typename Source>
86 string_cast(Source s) {
87 std::ostringstream oss;
89 return Target(oss.str());
94 inline static InstanceID cast(U i) {
101 KeyTypes::cast<long long>(
long long i) {
106 KeyTypes::cast<unsigned long long>(
unsigned long long i) {
mpz_class InstanceID
some classes need to have distinct instances to have unique InstanceID's, e.g. generalized Singletons...
Definition: key.h:80
Type/Instance combination serves as a key to quickly compare 2 polymorphic Singletons.
Definition: key.h:32
Defaults definitions for various parameters assumed by Libint.
Definition: algebra.cc:23
unsigned int ClassID
distinct classes have unique ClassID's
Definition: key.h:78
TypeAndInstance< KeyTypes::ClassID, KeyTypes::InstanceID > DGVertexKey
this composite hashing key works for DGVertex
Definition: key.h:112
Collection of types used for constructing keys in libint2.
Definition: key.h:76