14package com.google.ortools.sat;
16import com.google.ortools.sat.CpModelProto;
17import com.google.ortools.sat.TableConstraintProto;
25public class TableConstraint
extends Constraint {
38 TableConstraintProto.Builder table =
getBuilder().getTableBuilder();
39 if (tuple.length != table.getVarsCount()) {
41 "addTuple",
"tuple does not have the same length as the variables");
43 for (
int value : tuple) {
44 table.addValues(value);
57 TableConstraintProto.Builder table =
getBuilder().getTableBuilder();
58 if (tuple.length != table.getVarsCount()) {
60 "addTuple",
"tuple does not have the same length as the variables");
62 for (
long value : tuple) {
63 table.addValues(value);
76 TableConstraintProto.Builder table =
getBuilder().getTableBuilder();
77 for (
int[] tuple : tuples) {
78 if (tuple.length != table.getVarsCount()) {
80 "addTuples",
"a tuple does not have the same length as the variables");
82 for (
int value : tuple) {
83 table.addValues(value);
97 TableConstraintProto.Builder table =
getBuilder().getTableBuilder();
98 for (
long[] tuple : tuples) {
99 if (tuple.length != table.getVarsCount()) {
101 "addTuples",
"a tuple does not have the same length as the variables");
103 for (
long value : tuple) {
104 table.addValues(value);