Skip to content

Commit

Permalink
Add SDP support (#29)
Browse files Browse the repository at this point in the history
* Add SDP support

* Fix

* Cleanup

* Add failing tests

* Include back fixed tests

* Fix tests by decreasing tol

* Simplify
  • Loading branch information
blegat authored May 15, 2024
1 parent 2a64d52 commit d23fd80
Show file tree
Hide file tree
Showing 5 changed files with 233 additions and 153 deletions.
11 changes: 11 additions & 0 deletions src/DSDP.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,21 @@ function CreateBCone(dsdp::DSDPT)
bcone[]
end

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

function PrintSolution(fp::Libc.FILE,dsdp::DSDPT,sdpcone::SDPCone.SDPConeT,lpcone::LPCone.LPConeT)
@dsdp_ccall DSDPPrintSolution (Ptr{Cvoid}, DSDPT, SDPCone.SDPConeT, LPCone.LPConeT) fp dsdp sdpcone lpcone
end

function PrintSolution(dsdp::DSDPT,sdpcone::SDPCone.SDPConeT,lpcone::LPCone.LPConeT)
# See https://discourse.julialang.org/t/access-c-stdout-in-julia/24187/2
stdout = Libc.FILE(Libc.RawFD(1), "w")
return PrintSolution(stdout, dsdp, sdpcone, lpcone)
end

#function PrintSolution(arg1, arg2::DSDPT, arg3::SDPCone.SDPConeT, arg4::LPCone.LPConeT)
# @dsdp_ccall DSDPPrintSolution (Ptr{FILE}, DSDP, SDPCone.SDPConeT, LPCone.LPConeT) arg1 arg2 arg3 arg4
#end
Expand Down
Loading

0 comments on commit d23fd80

Please sign in to comment.