Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lperron committed Oct 25, 2024
1 parent 85f80a4 commit 06641b3
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions ortools/sat/csharp/Constraints.cs
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ public TableConstraint(CpModelProto model) : base(model)
*
* <param name="tuple"> the tuple to add to the constraint</param>
* <exception cref="ArgumentException"> if the tuple does not have the same length as the array of
* variables of the constraint</exception>
* expressions of the constraint</exception>
*/
public TableConstraint AddTuple(IEnumerable<int> tuple)
{
Expand All @@ -173,9 +173,9 @@ public TableConstraint AddTuple(IEnumerable<int> tuple)
table.Values.Add(value);
count++;
}
if (count != table.Vars.Count)
if (count != table.Exprs.Count)
{
throw new ArgumentException("addTuple", "tuple does not have the same length as the variables");
throw new ArgumentException("addTuple", "tuple does not have the same length as the expressions");
}
return this;
}
Expand All @@ -187,7 +187,7 @@ public TableConstraint AddTuple(IEnumerable<int> tuple)
*
* <param name="tuple"> the tuple to add to the constraint</param>
* <exception cref="ArgumentException"> if the tuple does not have the same length as the array of
* variables of the constraint</exception>
* expressions of the constraint</exception>
*/
public TableConstraint AddTuple(IEnumerable<long> tuple)
{
Expand All @@ -199,9 +199,9 @@ public TableConstraint AddTuple(IEnumerable<long> tuple)
table.Values.Add(value);
count++;
}
if (count != table.Vars.Count)
if (count != table.Exprs.Count)
{
throw new ArgumentException("addTuple", "tuple does not have the same length as the variables");
throw new ArgumentException("addTuple", "tuple does not have the same length as the expressions");
}
return this;
}
Expand All @@ -213,15 +213,15 @@ public TableConstraint AddTuple(IEnumerable<long> tuple)
*
* <param name="tuples"> the set of tuple to add to the constraint</param>
* <exception cref="ArgumentException"> if the tuple does not have the same length as the array of
* variables of the constraint</exception>
* expressions of the constraint</exception>
*/
public TableConstraint AddTuples(int[,] tuples)
{
TableConstraintProto table = Proto.Table;

if (tuples.GetLength(1) != table.Vars.Count)
if (tuples.GetLength(1) != table.Exprs.Count)
{
throw new ArgumentException("addTuples", "tuples does not have the same length as the variables");
throw new ArgumentException("addTuples", "tuples does not have the same length as the expressions");
}

for (int i = 0; i < tuples.GetLength(0); ++i)
Expand All @@ -241,15 +241,15 @@ public TableConstraint AddTuples(int[,] tuples)
*
* <param name="tuples"> the set of tuple to add to the constraint</param>
* <exception cref="ArgumentException"> if the tuple does not have the same length as the array of
* variables of the constraint</exception>
* expressions of the constraint</exception>
*/
public TableConstraint AddTuples(long[,] tuples)
{
TableConstraintProto table = Proto.Table;

if (tuples.GetLength(1) != table.Vars.Count)
if (tuples.GetLength(1) != table.Exprs.Count)
{
throw new ArgumentException("addTuples", "tuples does not have the same length as the variables");
throw new ArgumentException("addTuples", "tuples does not have the same length as the expressions");
}

for (int i = 0; i < tuples.GetLength(0); ++i)
Expand Down

0 comments on commit 06641b3

Please sign in to comment.