Google OR-Tools: ortools/constraint_solver/element.cc File Reference
#include <algorithm>
#include <cstdint>
#include <functional>
#include <limits>
#include <memory>
#include <numeric>
#include <string>
#include <utility>
#include <vector>
#include "absl/strings/str_format.h"
#include "absl/strings/str_join.h"
#include "ortools/base/logging.h"
#include "ortools/base/types.h"
#include "ortools/constraint_solver/constraint_solver.h"
#include "ortools/constraint_solver/constraint_solveri.h"
#include "ortools/util/range_minimum_query.h"
#include "ortools/util/string_array.h"
Go to the source code of this file.
Macros | |
| #define | UPDATE_RMQ_BASE_ELEMENT_INDEX_BOUNDS(test) |
| #define | UPDATE_ELEMENT_INDEX_BOUNDS(test) |
◆ UPDATE_ELEMENT_INDEX_BOUNDS
| #define UPDATE_ELEMENT_INDEX_BOUNDS | ( | test | ) |
◆ UPDATE_RMQ_BASE_ELEMENT_INDEX_BOUNDS
| #define UPDATE_RMQ_BASE_ELEMENT_INDEX_BOUNDS | ( | test | ) |
Value:
const std::vector<int64_t>& values = min_rmq_.array(); \
int64_t index_min = IndexMin(); \
int64_t index_max = IndexMax(); \
int64_t value = values[index_min]; \
while (index_min < index_max && (test)) { \
index_min++; \
value = values[index_min]; \
} \
if (index_min == index_max && (test)) { \
solver()->Fail(); \
} \
value = values[index_max]; \
while (index_max >= index_min && (test)) { \
index_max--; \
value = values[index_max]; \
} \
index_->SetRange(index_min, index_max);
Definition at line 424 of file element.cc.
◆ ABSL_FLAG()
| ABSL_FLAG | ( | bool | , |
| cp_disable_element_cache | , | ||
| true | , | ||
| "If | true, | ||
| caching for IntElement is disabled." | ) |