Skip to content

Commit d23fd80

Browse files
authored
Add SDP support (#29)
* Add SDP support * Fix * Cleanup * Add failing tests * Include back fixed tests * Fix tests by decreasing tol * Simplify
1 parent 2a64d52 commit d23fd80

File tree

5 files changed

+233
-153
lines changed

5 files changed

+233
-153
lines changed

src/DSDP.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,10 +39,21 @@ function CreateBCone(dsdp::DSDPT)
3939
bcone[]
4040
end
4141

42+
# Writes to `input.sdpa`
4243
function PrintData(dsdp::DSDPT, sdpcone::SDPCone.SDPConeT, lpcone::LPCone.LPConeT)
4344
@dsdp_ccall DSDPPrintData (DSDPT, SDPCone.SDPConeT, LPCone.LPConeT) dsdp sdpcone lpcone
4445
end
4546

47+
function PrintSolution(fp::Libc.FILE,dsdp::DSDPT,sdpcone::SDPCone.SDPConeT,lpcone::LPCone.LPConeT)
48+
@dsdp_ccall DSDPPrintSolution (Ptr{Cvoid}, DSDPT, SDPCone.SDPConeT, LPCone.LPConeT) fp dsdp sdpcone lpcone
49+
end
50+
51+
function PrintSolution(dsdp::DSDPT,sdpcone::SDPCone.SDPConeT,lpcone::LPCone.LPConeT)
52+
# See https://discourse.julialang.org/t/access-c-stdout-in-julia/24187/2
53+
stdout = Libc.FILE(Libc.RawFD(1), "w")
54+
return PrintSolution(stdout, dsdp, sdpcone, lpcone)
55+
end
56+
4657
#function PrintSolution(arg1, arg2::DSDPT, arg3::SDPCone.SDPConeT, arg4::LPCone.LPConeT)
4758
# @dsdp_ccall DSDPPrintSolution (Ptr{FILE}, DSDP, SDPCone.SDPConeT, LPCone.LPConeT) arg1 arg2 arg3 arg4
4859
#end

0 commit comments

Comments
 (0)