You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -350,15 +352,18 @@ function _setcoefficient!(dest::Optimizer, coef, constr::Integer, vi::MOI.Variab
350
352
push!(dest.lpcoefs, coef)
351
353
else
352
354
sdp = dest.blk[blk]
353
-
push!(dest.sdpdinds[end][sdp], i + (j -1) * dest.blockdims[blk] -1)
355
+
push!(
356
+
dest.sdpdinds[end][sdp],
357
+
i + (j -1) * dest.blockdims[blk] -1,
358
+
)
354
359
if i != j
355
360
coef /=2
356
361
end
357
362
push!(dest.sdpdcoefs[end][sdp], coef)
358
363
end
359
364
else
360
365
d =Cint(dest.blockdims[blk])
361
-
push!(dest.cached_ind, collect(Cint(0):(d-1)))
366
+
push!(dest.cached_ind, collect(Cint(0):(d-1)))
362
367
# We use `Add` and not `Set` because I think (if I interpret the name correctly) that would allow mixing with sparse matrices for the same block and constraint
363
368
DSDP.SDPCone.SetARankOneMat(
364
369
dest.sdpcone,
@@ -385,8 +390,27 @@ end
385
390
function_set_A_matrices(m::Optimizer, i)
386
391
for (blk, blkdim) inzip(m.blk, m.blockdims)
387
392
if blkdim >0&&!isempty(m.sdpdcoefs[end][blk])
388
-
@show (blk -1, i, blkdim, 1.0, 0, m.sdpdinds[end][blk], m.sdpdcoefs[end][blk], length(m.sdpdcoefs[end][blk]))
389
-
SDPCone.SetASparseVecMat(m.sdpcone, blk -1, i, blkdim, 1.0, 0, m.sdpdinds[end][blk], m.sdpdcoefs[end][blk], length(m.sdpdcoefs[end][blk]))
393
+
@show (
394
+
blk -1,
395
+
i,
396
+
blkdim,
397
+
1.0,
398
+
0,
399
+
m.sdpdinds[end][blk],
400
+
m.sdpdcoefs[end][blk],
401
+
length(m.sdpdcoefs[end][blk]),
402
+
)
403
+
SDPCone.SetASparseVecMat(
404
+
m.sdpcone,
405
+
blk -1,
406
+
i,
407
+
blkdim,
408
+
1.0,
409
+
0,
410
+
m.sdpdinds[end][blk],
411
+
m.sdpdcoefs[end][blk],
412
+
length(m.sdpdcoefs[end][blk]),
413
+
)
390
414
end
391
415
end
392
416
return
@@ -416,12 +440,7 @@ function MOI.copy_to(dest::Optimizer, src::MOI.ModelLike)
@dsdp_ccall SDPConeSetARankOneMat (SDPConeT, Cint, Cint, Cint, Cdouble, Cint, Ptr{Cint}, Ptr{Cdouble}, Cint) sdpcone blockj vari n alpha ishift ind val nnz
@dsdp_ccall SDPConeAddARankOneMat (SDPConeT, Cint, Cint, Cint, Cdouble, Cint, Ptr{Cint}, Ptr{Cdouble}, Cint) sdpcone blockj vari n alpha ishift ind val nnz
0 commit comments