Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions src/aff_expr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -311,13 +311,6 @@ end
function Base.convert(::Type{GenericAffExpr{T,V}}, v::_Constant) where {T,V}
return GenericAffExpr{T,V}(convert(T, _constant_to_number(v)))
end
# Used in `JuMP._mul!`.
function Base.convert(::Type{T}, aff::GenericAffExpr{T}) where T
if !isempty(aff.terms)
throw(InexactError(:convert, T, aff))
end
return convert(T, aff.constant)
end

# Alias for (Float64, VariableRef), the specific GenericAffExpr used by JuMP
const AffExpr = GenericAffExpr{Float64,VariableRef}
Expand Down
7 changes: 0 additions & 7 deletions src/quad_expr.jl
Original file line number Diff line number Diff line change
Expand Up @@ -324,13 +324,6 @@ function Base.convert(::Type{GenericQuadExpr{C, V}}, v::Union{_Constant,Abstract
return GenericQuadExpr(convert(GenericAffExpr{C, V}, v))
end
GenericQuadExpr{C, V}() where {C, V} = zero(GenericQuadExpr{C, V})
# Used in `JuMP._mul!`.
function Base.convert(::Type{T}, quad::GenericQuadExpr{T}) where T
if !isempty(quad.terms)
throw(InexactError(:convert, T, quad))
end
return convert(T, quad.aff)
end

function check_belongs_to_model(q::GenericQuadExpr, model::AbstractModel)
check_belongs_to_model(q.aff, model)
Expand Down