Skip to content

Commit d27f15c

Browse files
fix errors with Cint
1 parent 116d672 commit d27f15c

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/MOI/MOI_wrapper.jl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3259,19 +3259,19 @@ end
32593259

32603260
function MOI.modify(
32613261
model::Optimizer,
3262-
cis::Vector{MOI.ConstraintIndex{MOI.ScalarAffineFunction{Float64}, <:Any}},
3262+
cis::Vector{MOI.ConstraintIndex{MOI.ScalarAffineFunction{Float64}, S}},
32633263
chgs::Vector{MOI.ScalarCoefficientChange{Float64}}
3264-
)
3264+
) where {S}
32653265
nels = length(cis)
32663266
@assert nels == length(chgs)
32673267

3268-
rows = Vector{Int}(undef, nels)
3269-
cols = Vector{Int}(undef, nels)
3268+
rows = Vector{Cint}(undef, nels)
3269+
cols = Vector{Cint}(undef, nels)
32703270
coefs = Vector{Float64}(undef, nels)
32713271

32723272
for i in 1:nels
3273-
rows[i] = _info(model, cis[i]).row
3274-
cols[i] = _info(model, chgs[i].variable).column
3273+
rows[i] = Cint(_info(model, cis[i]).row)
3274+
cols[i] = Cint(_info(model, chgs[i].variable).column)
32753275
coefs[i] = chgs[i].new_coefficient
32763276
end
32773277

@@ -3303,6 +3303,7 @@ function MOI.modify(
33033303
chgs::Vector{MOI.ScalarCoefficientChange{Float64}}
33043304
)
33053305
@assert model.objective_type == SCALAR_AFFINE
3306+
nels = length(chgs)
33063307
cols = Vector{Int}(undef, nels)
33073308
coefs = Vector{Float64}(undef, nels)
33083309

src/api.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2271,7 +2271,7 @@ Used to change multiple coefficients in the matrix. If any coefficient does not
22712271
22722272
"""
22732273
function chgmcoef(prob::XpressProblem, ncoeffs, _mrow::Vector{<:Integer}, _mcol::Vector{<:Integer}, _dval)
2274-
@checked Lib.XPRSchgmcoef(prob, ncoeffs, _mrow .- 1, _mcol .- 1, _dval)
2274+
@checked Lib.XPRSchgmcoef(prob, ncoeffs, _mrow .- one(Cint), _mcol .- one(Cint), _dval)
22752275
end
22762276

22772277
# # Disable 64Bit versions do to reliability issues.

0 commit comments

Comments
 (0)