27 #include "ortools/flatzinc/parser.tab.hh"
37 LOG(ERROR) <<
"Error: " << str <<
" in line no. " <<
orfz_get_lineno(scanner);
45 bool ContainsId(std::vector<Annotation>* annotations,
const std::string&
id) {
46 if (annotations !=
nullptr) {
47 for (
int i = 0; i < annotations->size(); ++i) {
50 (*annotations)[i].
id ==
id) {
59 for (
int i = 0; i < domains.size(); ++i) {
60 if (!domains[i].HasOneValue()) {
68 const double rounded = std::round(d);
69 const int64_t i =
static_cast<int64_t
>(rounded);
70 CHECK_LE(std::abs(
static_cast<double>(i) - rounded), 1e-9);
80 CHECK_LE(
index, v.size());
GurobiMPCallbackContext * context
const T & Lookup(const std::vector< T > &v, int index)
bool ContainsId(std::vector< Annotation > *annotations, const std::string &id)
int64_t ConvertAsIntegerOrDie(double d)
bool AllDomainsHaveOneValue(const std::vector< Domain > &domains)
Collection of objects used to extend the Constraint Solver library.
int orfz_lex(YYSTYPE *, void *scanner)
int orfz_get_lineno(void *scanner)
void orfz_error(operations_research::fz::ParserContext *context, operations_research::fz::Model *model, bool *ok, void *scanner, const char *str)