From b1ddb6482ecf6b715d0c13d649ac3fc03c8ed90d Mon Sep 17 00:00:00 2001 From: Ben Smith Date: Fri, 23 Nov 2018 18:20:48 +0100 Subject: [PATCH] remove assumption that first column of constraint system is always 1 --- src/main/java/relations/objects/LinearCombination.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/main/java/relations/objects/LinearCombination.java b/src/main/java/relations/objects/LinearCombination.java index 979b91e..e9cd4d9 100755 --- a/src/main/java/relations/objects/LinearCombination.java +++ b/src/main/java/relations/objects/LinearCombination.java @@ -38,11 +38,10 @@ public boolean isValid(final int numVariables) { public FieldT evaluate(final Assignment input) { FieldT result = input.get(0).zero(); - final FieldT one = result.one(); for (int i = 0; i < terms.size(); i++) { final long index = terms.get(i).index(); - final FieldT value = index == 0 ? one : input.get((int) index).mul(terms.get(i).value()); + final FieldT value = input.get((int) index).mul(terms.get(i).value()); result = result.add(value); }