Google OR-Tools v9.11
a fast and portable software suite for combinatorial optimization
Loading...
Searching...
No Matches
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.

Classes

class  operations_research::IfThenElseCt
 -------— Generalized element -------— More...
 

Namespaces

namespace  operations_research
 In SWIG mode, we don't want anything besides these top-level includes.
 

Macros

#define UPDATE_RMQ_BASE_ELEMENT_INDEX_BOUNDS(test)
 
#define UPDATE_ELEMENT_INDEX_BOUNDS(test)
 

Functions

 ABSL_FLAG (bool, cp_disable_element_cache, true, "If true, caching for IntElement is disabled.")
 
void operations_research::LinkVarExpr (Solver *s, IntExpr *expr, IntVar *var)
 --— IntExprElement --—
 

Macro Definition Documentation

◆ UPDATE_ELEMENT_INDEX_BOUNDS

#define UPDATE_ELEMENT_INDEX_BOUNDS ( test)

Definition at line 988 of file element.cc.

◆ 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);
int64_t value

Definition at line 424 of file element.cc.

Function Documentation

◆ ABSL_FLAG()

ABSL_FLAG ( bool ,
cp_disable_element_cache ,
true ,
"If true,
caching for IntElement is disabled."  )

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Variable Documentation

◆ expr_

IntVar* const expr_
protected

Definition at line 88 of file element.cc.