Skip to content

Commit dbd8b9c

Browse files
authored
allow some fields of a struct to be integer (#11)
1 parent cd5c3e8 commit dbd8b9c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/models/model.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ mutable struct Model{Tv <: AbstractVector} <: AbstractModel
2525
box_min::Tv
2626
box_max::Tv
2727
init::Tv
28-
integer::BitVector
28+
integer::AbstractVector
2929
end
3030

3131
"""
@@ -34,7 +34,7 @@ end
3434
3535
Constructs an empty model or a model with objective function `f`. The decision variables are assumed to be of type `Vector{Any}`.
3636
"""
37-
Model(f::Union{Nothing, Function} = nothing) = Model(Any, f)
37+
Model(f::Union{Nothing, Function} = x -> 0.0) = Model(Any, f)
3838

3939
"""
4040
Model(::Type{T}, f::Union{Nothing, Function}) where {T}
@@ -48,7 +48,7 @@ function Model(::Type{T}, obj::Union{Nothing, Objective}) where {T}
4848
VectorOfFunctions(IneqConstraint[]),
4949
VectorOfFunctions(SDConstraint[]),
5050
T[], T[], T[],
51-
falses(0))
51+
[])
5252
end
5353

5454
getobjective(m::AbstractModel) = m.objective

0 commit comments

Comments
 (0)