39 if ( var == 1 || var == -1 ) {
42 std::cerr <<
"Spin variable must be +1 or -1." << std::endl;
46 if ( var == 1 || var == 0 ) {
49 std::cerr <<
"Binary variable must be 1 or 0." << std::endl;
53 std::cerr <<
"Unknown variable type." << std::endl;
vartype
Definition: legacy/binary_quadratic_model.py:182
Definition: binary_polynomial_model.hpp:139
bool check_vartype(const int32_t &var, const Vartype &vartype)
Check that the variable has appropriate value.
Definition: vartypes.hpp:37
Vartype
Enum class for representing problem type.
Definition: vartypes.hpp:24