This commit is contained in:
Laurent Perron
2024-10-25 17:56:21 +02:00
parent ee241f30b5
commit 719eb3bc82
2 changed files with 13 additions and 13 deletions

View File

@@ -161,7 +161,7 @@ public class TableConstraint : Constraint
*
* <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)
{
@@ -173,9 +173,9 @@ public class TableConstraint : Constraint
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;
}
@@ -187,7 +187,7 @@ public class TableConstraint : Constraint
*
* <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)
{
@@ -199,9 +199,9 @@ public class TableConstraint : Constraint
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;
}
@@ -213,15 +213,15 @@ public class TableConstraint : Constraint
*
* <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)
@@ -241,15 +241,15 @@ public class TableConstraint : Constraint
*
* <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)

View File

@@ -420,7 +420,7 @@ public class CpModel
{
AutomatonConstraintProto automaton = new AutomatonConstraintProto();
automaton.Vars.TrySetCapacity(expressions);
foreach (LinearExpr expr in exprs)
foreach (LinearExpr expr in expressions)
{
automaton.Exprs.Add(GetLinearExpressionProto(expr));
}