21#ifndef _libint2_src_bin_libint_key_h_
22#define _libint2_src_bin_libint_key_h_
25#include <libint2/util/intrinsic_types.h>
34template <
typename T,
typename I>
48 const Type& type()
const {
return t_; }
49 const Instance& instance()
const {
return i_; }
55 static Type invalid_type_;
56 static Instance invalid_instance_;
59template <
typename T,
typename I>
61template <
typename T,
typename I>
62typename TypeAndInstance<T, I>::Instance
65template <
typename T,
typename I>
68 return a.type() == b.type() && a.instance() == b.instance();
71template <
typename T,
typename I>
72bool operator<(
const TypeAndInstance<T, I>& a,
const TypeAndInstance<T, I>& b) {
73 bool result = (a.type() < b.type()) ||
74 ((a.type() == b.type()) && (a.instance() < b.instance()));
91 template <
typename Target,
typename Source>
92 static Target string_cast(Source s) {
93 std::ostringstream oss;
95 return Target(oss.str());
107 return string_cast<InstanceID>(i);
111 unsigned long long i) {
112 return string_cast<InstanceID>(i);
Type/Instance combination serves as a key to quickly compare 2 polymorphic Singletons.
Definition key.h:35
Defaults definitions for various parameters assumed by Libint.
Definition algebra.cc:24
TypeAndInstance< KeyTypes::ClassID, KeyTypes::InstanceID > DGVertexKey
this composite hashing key works for DGVertex
Definition key.h:116
Collection of types used for constructing keys in libint2.
Definition key.h:81
mpz_class InstanceID
some classes need to have distinct instances to have unique InstanceID's, e.g.
Definition key.h:86
unsigned int ClassID
distinct classes have unique ClassID's
Definition key.h:83