Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pedromxavier committed Nov 27, 2023
1 parent 13bb883 commit a543089
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 21 deletions.
18 changes: 0 additions & 18 deletions src/compiler/constraints.jl
Original file line number Diff line number Diff line change
Expand Up @@ -600,21 +600,3 @@ function constraint(

return nothing

Check warning on line 601 in src/compiler/constraints.jl

View check run for this annotation

Codecov / codecov/patch

src/compiler/constraints.jl#L601

Added line #L601 was not covered by tests
end


function encoding_constraints!(model::Virtual.Model{T}, ::AbstractArchitecture) where {T}
for v in model.variables
i = Virtual.source(v)
χ = Virtual.penaltyfn(v)

if !isnothing(χ)
if i isa VI
model.h[i] = χ
elseif i isa CI
model.s[i] = χ
end
end
end

return nothing
end
6 changes: 3 additions & 3 deletions test/integration/examples/quadratic/quadratic_2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@ min x₁ + x₂ + ρ (x₁ * x₂ - 1)²
"""
function test_quadratic_2()
ρ̄ = 3
ρ̄ = 4
= [
1 -ρ̄
0 2
]
ᾱ = 1
β̄ = 0
= [0, 1]
β̄ = ρ̄
= [1, 1]

model = Model(() -> ToQUBO.Optimizer(ExactSampler.Optimizer))

Expand Down

0 comments on commit a543089

Please sign in to comment.