mirror of
https://github.com/mudler/luet.git
synced 2025-09-13 05:42:52 +00:00
update vendor/
This commit is contained in:
7
vendor/github.com/crillab/gophersat/solver/pb.go
generated
vendored
7
vendor/github.com/crillab/gophersat/solver/pb.go
generated
vendored
@@ -57,12 +57,17 @@ func GtEq(lits []int, weights []int, n int) PBConstr {
|
||||
if len(weights) != 0 && len(lits) != len(weights) {
|
||||
panic("not as many lits as weights")
|
||||
}
|
||||
for i := range weights {
|
||||
for i := 0; i < len(weights); i++ {
|
||||
if weights[i] < 0 {
|
||||
weights[i] = -weights[i]
|
||||
n += weights[i]
|
||||
lits[i] = -lits[i]
|
||||
}
|
||||
if weights[i] == 0 {
|
||||
weights = append(weights[:i], weights[i+1:]...)
|
||||
lits = append(lits[:i], lits[i+1:]...)
|
||||
i--
|
||||
}
|
||||
}
|
||||
return PBConstr{Lits: lits, Weights: weights, AtLeast: n}
|
||||
}
|
||||
|
Reference in New Issue
Block a user