22#include "absl/strings/string_view.h"
38 LOG(ERROR) <<
"Error: " << str <<
" in line no. " <<
orfz_get_lineno(scanner);
46bool ContainsId(std::vector<Annotation>* annotations, absl::string_view
id) {
47 if (annotations !=
nullptr) {
48 for (
int i = 0; i < annotations->size(); ++i) {
51 (*annotations)[i].
id ==
id) {
60 for (
int i = 0; i < domains.size(); ++i) {
61 if (!domains[i].HasOneValue()) {
69 const double rounded = std::round(d);
70 const int64_t i =
static_cast<int64_t
>(rounded);
71 CHECK_LE(std::abs(
static_cast<double>(i) - rounded), 1e-9);
78const T&
Lookup(
const std::vector<T>& v,
int index) {
81 CHECK_LE(index, v.size());
const T & Lookup(const std::vector< T > &v, int index)
bool ContainsId(std::vector< Annotation > *annotations, absl::string_view id)
int64_t ConvertAsIntegerOrDie(double d)
bool AllDomainsHaveOneValue(const std::vector< Domain > &domains)
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)