cimod
C++ library for a binary (and polynomial) quadratic model.
utilities.hpp File Reference
#include <unordered_map>
#include <unordered_set>
#include "cimod/vartypes.hpp"
Include dependency graph for utilities.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

 cimod
 

Functions

template<class C_key , class C_value , class Hash >
void cimod::insert_or_assign (std::unordered_map< C_key, C_value, Hash > &um, const C_key &key, const C_value &val)
 Insert or assign a element of unordered_map (for C++14 or C++11) More...
 
template<typename IndexType >
void cimod::FormatPolynomialKey (std::vector< IndexType > *key, const Vartype &vartype)
 Format the input key: for example, {2,1,1}-->{1,2} for BINARY variable and {2,1,1}-->{2} for SPIN variable. More...
 
cimod::Vartype cimod::ToCimodVartype (const std::string &vartype_str)
 Convert vartype from string to cimod::Vartype. More...
 
template<typename IntegerType >
void cimod::CheckVariables (const std::vector< IntegerType > &configurations, const Vartype &vartype)
 Convert vartype from string to cimod::Vartype. More...
 
void cimod::CheckVartypeNotNONE (const Vartype &vartype)
 Check if the input vartype is not Vartype::NONE. More...