Skip to content

Commit

Permalink
Fix dfifferences
Browse files Browse the repository at this point in the history
  • Loading branch information
pedromxavier committed Nov 26, 2023
1 parent f4b072a commit 0ff3ac5
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/compiler/variables.jl
Original file line number Diff line number Diff line change
Expand Up @@ -98,19 +98,19 @@ function variable_𝔹!(model::Virtual.Model{T}, i::Union{VI,CI}) where {T}
return Encoding.encode!(model, i, Encoding.Mirror{T}())
end

function variable_β„€!(model::Virtual.Model{T}, x::VI, (a, b)::Tuple{A,B}) where {T,A<:Union{T,Nothing},B<:Union{T,Nothing}}
function variable_β„€!(model::Virtual.Model{T}, vi::VI, (a, b)::Tuple{A,B}) where {T,A<:Union{T,Nothing},B<:Union{T,Nothing}}
if !isnothing(a) && !isnothing(b)
let e = Attributes.variable_encoding_method(model, x)
let e = Attributes.variable_encoding_method(model, vi)
S = (a, b)

return Encoding.encode!(model, vi, e, S)
end
elseif !isnothing(b)
error("Unbounded variable $(x) ∈ (-∞, $(b)] βŠ‚ β„€ ")
error("Unbounded variable $(vi) ∈ (-∞, $(b)] βŠ‚ β„€ ")
elseif !isnothing(a)
error("Unbounded variable $(x) ∈ [$(a), +∞) βŠ‚ β„€")
error("Unbounded variable $(vi) ∈ [$(a), +∞) βŠ‚ β„€")

Check warning on line 111 in src/compiler/variables.jl

View check run for this annotation

Codecov / codecov/patch

src/compiler/variables.jl#L108-L111

Added lines #L108 - L111 were not covered by tests
else
error("Unbounded variable $(x) ∈ β„€")
error("Unbounded variable $(vi) ∈ β„€")

Check warning on line 113 in src/compiler/variables.jl

View check run for this annotation

Codecov / codecov/patch

src/compiler/variables.jl#L113

Added line #L113 was not covered by tests
end
end

Expand All @@ -126,7 +126,7 @@ function variable_β„€!(model::Virtual.Model{T}, ci::CI, (a, b)::Tuple{T,T}) wher
end
end

function variable_ℝ!(model::Virtual.Model{T}, x::VI, (a, b)::Tuple{A,B}) where {T,A<:Union{T,Nothing},B<:Union{T,Nothing}}
function variable_ℝ!(model::Virtual.Model{T}, vi::VI, (a, b)::Tuple{A,B}) where {T,A<:Union{T,Nothing},B<:Union{T,Nothing}}
if !isnothing(a) && !isnothing(b)
# TODO: Solve this bit-guessing magic??? (DONE)
# IDEA:
Expand Down Expand Up @@ -154,14 +154,14 @@ function variable_ℝ!(model::Virtual.Model{T}, x::VI, (a, b)::Tuple{A,B}) where
end
end
elseif !isnothing(b)
error("Unbounded variable $(x) ∈ (-∞, $(b)]")
error("Unbounded variable $(vi) ∈ (-∞, $(b)]")
elseif !isnothing(a)
error("Unbounded variable $(x) ∈ [$(a), +∞)")
error("Unbounded variable $(vi) ∈ [$(a), +∞)")

Check warning on line 159 in src/compiler/variables.jl

View check run for this annotation

Codecov / codecov/patch

src/compiler/variables.jl#L156-L159

Added lines #L156 - L159 were not covered by tests
else
@info "Source Model:"
println(model.source_model)

Check warning on line 162 in src/compiler/variables.jl

View check run for this annotation

Codecov / codecov/patch

src/compiler/variables.jl#L161-L162

Added lines #L161 - L162 were not covered by tests

error("Unbounded variable $(x) ∈ ℝ")
error("Unbounded variable $(vi) ∈ ℝ")

Check warning on line 164 in src/compiler/variables.jl

View check run for this annotation

Codecov / codecov/patch

src/compiler/variables.jl#L164

Added line #L164 was not covered by tests
end
end

Expand Down

0 comments on commit 0ff3ac5

Please sign in to comment.