OR-Tools  9.2
table.h
Go to the documentation of this file.
1 // Copyright 2010-2021 Google LLC
2 // Licensed under the Apache License, Version 2.0 (the "License");
3 // you may not use this file except in compliance with the License.
4 // You may obtain a copy of the License at
5 //
6 // http://www.apache.org/licenses/LICENSE-2.0
7 //
8 // Unless required by applicable law or agreed to in writing, software
9 // distributed under the License is distributed on an "AS IS" BASIS,
10 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11 // See the License for the specific language governing permissions and
12 // limitations under the License.
13 
14 #ifndef OR_TOOLS_SAT_TABLE_H_
15 #define OR_TOOLS_SAT_TABLE_H_
16 
17 #include <cstdint>
18 #include <functional>
19 #include <vector>
20 
21 #include "absl/types/span.h"
23 #include "ortools/sat/integer.h"
24 #include "ortools/sat/model.h"
25 #include "ortools/sat/sat_base.h"
26 
27 namespace operations_research {
28 namespace sat {
29 
30 // Enforces that exactly one literal in line_literals is true, and that
31 // all literals in the corresponding line of the literal_tuples matrix are true.
32 // This constraint assumes that exactly one literal per column of the
33 // literal_tuples matrix is true.
34 std::function<void(Model*)> LiteralTableConstraint(
35  const std::vector<std::vector<Literal>>& literal_tuples,
36  const std::vector<Literal>& line_literals);
37 
38 } // namespace sat
39 } // namespace operations_research
40 
41 #endif // OR_TOOLS_SAT_TABLE_H_
Class that owns everything related to a particular optimization model.
Definition: sat/model.h:38
Collection of objects used to extend the Constraint Solver library.
std::function< void(Model *)> LiteralTableConstraint(const std::vector< std::vector< Literal >> &literal_tuples, const std::vector< Literal > &line_literals)
Definition: table.h:34