Skip to content

Commit 6eabe72

Browse files
authored
Improvements to C wrapper (#32)
1 parent 9c5f121 commit 6eabe72

File tree

4 files changed

+75
-56
lines changed

4 files changed

+75
-56
lines changed

src/bcone.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,11 @@ function View(bcone::BConeT)
3333
@dsdp_ccall BConeView (BConeT,) bcone
3434
end
3535

36-
function SetXArray(bcone::BConeT, arg2, arg3::Integer)
36+
function SetXArray(bcone::BConeT, arg2::Vector{Cdouble}, arg3::Integer)
3737
@dsdp_ccall BConeSetXArray (BConeT, Ptr{Cdouble}, Cint) bcone arg2 arg3
3838
end
3939

40-
function CopyX(bcone::BConeT, arg2, arg3, arg4::Integer)
40+
function CopyX(bcone::BConeT, arg2::Vector{Cdouble}, arg3::Vector{Cdouble}, arg4::Integer)
4141
@dsdp_ccall BConeCopyX (BConeT, Ptr{Cdouble}, Ptr{Cdouble}, Cint) bcone arg2 arg3 arg4
4242
end
4343

src/dsdp5_API.jl

Lines changed: 31 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
# Automatically generated using Clang.jl wrap_c, version 0.0.0
33

44

5+
function LogInfoAllow(i::Integer)
6+
@dsdp_ccall DSDPLogInfoAllow (Cint, Ptr{Cchar}) i C_NULL
7+
end
8+
59
function SetConvergenceFlag(dsdp::DSDPT, arg2::DSDPTerminationReason)
610
@dsdp_ccall DSDPSetConvergenceFlag (DSDPT, DSDPTerminationReason) dsdp arg2
711
end
@@ -90,19 +94,19 @@ function GetPenaltyParameter(dsdp::DSDPT)
9094
pp[]
9195
end
9296

93-
function GetPenalty(dsdp::DSDPT, arg2)
97+
function GetPenalty(dsdp::DSDPT, arg2::Vector{Cdouble})
9498
@dsdp_ccall DSDPGetPenalty (DSDPT, Ptr{Cdouble}) dsdp arg2
9599
end
96100

97-
function CopyB(dsdp::DSDPT, arg2, arg3::Integer)
101+
function CopyB(dsdp::DSDPT, arg2::Vector{Cdouble}, arg3::Integer)
98102
@dsdp_ccall DSDPCopyB (DSDPT, Ptr{Cdouble}, Cint) dsdp arg2 arg3
99103
end
100104

101105
function SetR0(dsdp::DSDPT, arg2::Cdouble)
102106
@dsdp_ccall DSDPSetR0 (DSDPT, Cdouble) dsdp arg2
103107
end
104108

105-
function GetR(dsdp::DSDPT, arg2)
109+
function GetR(dsdp::DSDPT, arg2::Vector{Cdouble})
106110
@dsdp_ccall DSDPGetR (DSDPT, Ptr{Cdouble}) dsdp arg2
107111
end
108112

@@ -132,7 +136,7 @@ function GetDYMakeX(dsdp::DSDPT, arg2, arg3::Integer)
132136
@dsdp_ccall DSDPGetDYMakeX (DSDPT, Ptr{Cdouble}, Cint) dsdp arg2 arg3
133137
end
134138

135-
function GetMuMakeX(dsdp::DSDPT, arg2)
139+
function GetMuMakeX(dsdp::DSDPT, arg2::Vector{Cdouble})
136140
@dsdp_ccall DSDPGetMuMakeX (DSDPT, Ptr{Cdouble}) dsdp arg2
137141
end
138142

@@ -156,7 +160,7 @@ function GetReuseMatrix(dsdp::DSDPT)
156160
reuse[]
157161
end
158162

159-
function GetDimension(dsdp::DSDPT, arg2)
163+
function GetDimension(dsdp::DSDPT, arg2::Vector{Cdouble})
160164
@dsdp_ccall DSDPGetDimension (DSDPT, Ptr{Cdouble}) dsdp arg2
161165
end
162166

@@ -222,7 +226,7 @@ function GetPTolerance(dsdp::DSDPT)
222226
ptol[]
223227
end
224228

225-
function GetPInfeasibility(dsdp::DSDPT, arg2)
229+
function GetPInfeasibility(dsdp::DSDPT, arg2::Vector{Cdouble})
226230
@dsdp_ccall DSDPGetPInfeasibility (DSDPT, Ptr{Cdouble}) dsdp arg2
227231
end
228232

@@ -262,39 +266,43 @@ function UseDynamicRho(dsdp::DSDPT, arg2::Integer)
262266
@dsdp_ccall DSDPUseDynamicRho (DSDPT, Cint) dsdp arg2
263267
end
264268

265-
function GetPotential(dsdp::DSDPT, arg2)
269+
function GetPotential(dsdp::DSDPT, arg2::Vector{Cdouble})
266270
@dsdp_ccall DSDPGetPotential (DSDPT, Ptr{Cdouble}) dsdp arg2
267271
end
268272

269273
function UseLAPACKForSchur(dsdp::DSDPT, arg2::Integer)
270274
@dsdp_ccall DSDPUseLAPACKForSchur (DSDPT, Cint) dsdp arg2
271275
end
272276

273-
function GetNumberOfVariables(dsdp::DSDPT, arg2)
277+
function GetNumberOfVariables(dsdp::DSDPT, arg2::Vector{Cint})
274278
@dsdp_ccall DSDPGetNumberOfVariables (DSDPT, Ptr{Cint}) dsdp arg2
275279
end
276280

277-
function GetFinalErrors(dsdp::DSDPT, arg2::NTuple{6, Cdouble})
278-
@dsdp_ccall DSDPGetFinalErrors (DSDPT, NTuple{6, Cdouble}) dsdp arg2
281+
function GetFinalErrors(dsdp::DSDPT)
282+
err = zeros(Cdouble, 6)
283+
@dsdp_ccall DSDPGetFinalErrors (DSDPT, Ptr{Cdouble}) dsdp err
284+
return err
279285
end
280286

281-
function GetGapHistory(dsdp::DSDPT, arg2, arg3::Integer)
287+
function GetGapHistory(dsdp::DSDPT, arg2::Vector{Cdouble}, arg3::Integer)
282288
@dsdp_ccall DSDPGetGapHistory (DSDPT, Ptr{Cdouble}, Cint) dsdp arg2 arg3
283289
end
284290

285-
function GetRHistory(dsdp::DSDPT, arg2, arg3::Integer)
291+
function GetRHistory(dsdp::DSDPT, arg2::Vector{Cdouble}, arg3::Integer)
286292
@dsdp_ccall DSDPGetRHistory (DSDPT, Ptr{Cdouble}, Cint) dsdp arg2 arg3
287293
end
288294

289-
function GetIts(dsdp::DSDPT, arg2)
290-
@dsdp_ccall DSDPGetIts (DSDPT, Ptr{Cint}) dsdp arg2
295+
function GetIts(dsdp::DSDPT)
296+
its = Ref{Cint}()
297+
@dsdp_ccall DSDPGetIts (DSDPT, Ptr{Cint}) dsdp its
298+
return its[]
291299
end
292300

293-
function GetPnorm(dsdp::DSDPT, arg2)
301+
function GetPnorm(dsdp::DSDPT, arg2::Vector{Cdouble})
294302
@dsdp_ccall DSDPGetPnorm (DSDPT, Ptr{Cdouble}) dsdp arg2
295303
end
296304

297-
function GetStepLengths(dsdp::DSDPT, arg2, arg3)
305+
function GetStepLengths(dsdp::DSDPT, arg2::Vector{Cdouble}, arg3::Vector{Cdouble})
298306
@dsdp_ccall DSDPGetStepLengths (DSDPT, Ptr{Cdouble}, Ptr{Cdouble}) dsdp arg2 arg3
299307
end
300308

@@ -322,11 +330,11 @@ function PrintLogInfo(arg1::Integer)
322330
@dsdp_ccall DSDPPrintLogInfo (Cint,) arg1
323331
end
324332

325-
function ComputeMinimumXEigenvalue(dsdp::DSDPT, arg2)
333+
function ComputeMinimumXEigenvalue(dsdp::DSDPT, arg2::Vector{Cdouble})
326334
@dsdp_ccall DSDPComputeMinimumXEigenvalue (DSDPT, Ptr{Cdouble}) dsdp arg2
327335
end
328336

329-
function GetTraceX(dsdp::DSDPT, sdpcone)
337+
function GetTraceX(dsdp::DSDPT, sdpcone::Vector{Cdouble})
330338
@dsdp_ccall DSDPGetTraceX (DSDPT, Ptr{Cdouble}) dsdp sdpcone
331339
end
332340

@@ -342,7 +350,7 @@ function GetDataNorms(dsdp::DSDPT, arg2::NTuple{3, Cdouble})
342350
@dsdp_ccall DSDPGetDataNorms (DSDPT, NTuple{3, Cdouble}) dsdp arg2
343351
end
344352

345-
function GetYMaxNorm(dsdp::DSDPT, arg2)
353+
function GetYMaxNorm(dsdp::DSDPT, arg2::Vector{Cdouble})
346354
@dsdp_ccall DSDPGetYMaxNorm (DSDPT, Ptr{Cdouble}) dsdp arg2
347355
end
348356

@@ -365,11 +373,11 @@ function SetFixedVariable(dsdp::DSDPT, arg2::Integer, arg3::Cdouble)
365373
@dsdp_ccall DSDPSetFixedVariable (DSDPT, Cint, Cdouble) dsdp arg2 arg3
366374
end
367375

368-
function SetFixedVariables(dsdp::DSDPT, arg2, arg3, arg4, arg5::Integer)
376+
function SetFixedVariables(dsdp::DSDPT, arg2::Vector{Cdouble}, arg3::Vector{Cdouble}, arg4::Vector{Cdouble}, arg5::Integer)
369377
@dsdp_ccall DSDPSetFixedVariables (DSDPT, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}, Cint) dsdp arg2 arg3 arg4 arg5
370378
end
371379

372-
function GetFixedYX(dsdp::DSDPT, arg2::Integer, arg3)
380+
function GetFixedYX(dsdp::DSDPT, arg2::Integer, arg3::Vector{Cdouble})
373381
@dsdp_ccall DSDPGetFixedYX (DSDPT, Cint, Ptr{Cdouble}) dsdp arg2 arg3
374382
end
375383

@@ -381,11 +389,11 @@ function PrintOptions()
381389
ccall((:DSDPPrintOptions, libdsdp), Cint, ())
382390
end
383391

384-
function SetOptions(dsdp::DSDPT, arg2, arg3::Integer)
392+
function SetOptions(dsdp::DSDPT, arg2::Vector{Cstring}, arg3::Integer)
385393
@dsdp_ccall DSDPSetOptions (DSDPT, Ptr{Cstring}, Cint) dsdp arg2 arg3
386394
end
387395

388-
function ReadOptions(dsdp::DSDPT, arg2)
396+
function ReadOptions(dsdp::DSDPT, arg2::Vector{UInt8})
389397
@dsdp_ccall DSDPReadOptions (DSDPT, Ptr{UInt8}) dsdp arg2
390398
end
391399

src/lpcone.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,11 @@ function SetData(lpcone::LPConeT, n::Integer, nnzin::Vector{Cint}, row::Vector{C
3838
@dsdp_ccall LPConeSetData (LPConeT, Cint, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}) lpcone n nnzin row aval
3939
end
4040

41-
function SetData2(arg1::LPConeT, arg2::Integer, arg3, arg4, arg5)
41+
function SetData2(arg1::LPConeT, arg2::Integer, arg3::Vector{Cint}, arg4::Vector{Cint}, arg5::Vector{Cdouble})
4242
@dsdp_ccall LPConeSetData2 (LPConeT, Cint, Ptr{Cint}, Ptr{Cint}, Ptr{Cdouble}) arg1 arg2 arg3 arg4 arg5
4343
end
4444

45-
function GetData(arg1::LPConeT, arg2::Integer, arg3, arg4::Integer)
45+
function GetData(arg1::LPConeT, arg2::Integer, arg3::Vector{Cdouble}, arg4::Integer)
4646
@dsdp_ccall LPConeGetData (LPConeT, Cint, Ptr{Cdouble}, Cint) arg1 arg2 arg3 arg4
4747
end
4848

@@ -78,7 +78,7 @@ function View2(lpcone::LPConeT)
7878
@dsdp_ccall LPConeView2 (LPConeT,) lpcone
7979
end
8080

81-
function CopyS(arg1::LPConeT, arg2, arg3::Integer)
81+
function CopyS(arg1::LPConeT, arg2::Vector{Cdouble}, arg3::Integer)
8282
@dsdp_ccall LPConeCopyS (LPConeT, Ptr{Cdouble}, Cint) arg1 arg2 arg3
8383
end
8484

src/sdpcone.jl

Lines changed: 39 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,20 @@ function SetBlockSize(sdpcone::SDPConeT, i::Integer, j::Integer)
99
@dsdp_ccall SDPConeSetBlockSize (SDPConeT, Cint, Cint) sdpcone i j
1010
end
1111

12-
function GetBlockSize(sdpcone::SDPConeT, arg2::Integer, arg3)
13-
@dsdp_ccall SDPConeGetBlockSize (SDPConeT, Cint, Ptr{Cint}) sdpcone arg2 arg3
12+
function GetBlockSize(sdpcone::SDPConeT, arg2::Integer)
13+
n = Ref{Cint}()
14+
@dsdp_ccall SDPConeGetBlockSize (SDPConeT, Cint, Ref{Cint}) sdpcone arg2 n
15+
return n[]
1416
end
1517

1618
function SetStorageFormat(sdpcone::SDPConeT, arg2::Integer, arg3::UInt8)
1719
@dsdp_ccall SDPConeSetStorageFormat (SDPConeT, Cint, UInt8) sdpcone arg2 arg3
1820
end
1921

20-
function GetStorageFormat(sdpcone::SDPConeT, arg2::Integer, arg3)
21-
@dsdp_ccall SDPConeGetStorageFormat (SDPConeT, Cint, Cstring) sdpcone arg2 arg3
22+
function GetStorageFormat(sdpcone::SDPConeT, arg2::Integer)
23+
format = Ref{Cchar}()
24+
@dsdp_ccall SDPConeGetStorageFormat (SDPConeT, Cint, Ref{Cchar}) sdpcone arg2 format
25+
return format[]
2226
end
2327

2428
function CheckStorageFormat(sdpcone::SDPConeT, arg2::Integer, arg3::UInt8)
@@ -41,15 +45,15 @@ function View3(sdpcone::SDPConeT)
4145
@dsdp_ccall SDPConeView3 (SDPConeT,) sdpcone
4246
end
4347

44-
function SetASparseVecMat(sdpcone::SDPConeT, arg2::Integer, arg3::Integer, arg4::Integer, arg5::Cdouble, arg6::Integer, arg7, arg8, arg9::Integer)
45-
@dsdp_ccall SDPConeSetASparseVecMat (SDPConeT, Cint, Cint, Cint, Cdouble, Cint, Ptr{Cint}, Ptr{Cdouble}, Cint) sdpcone arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9
48+
function SetASparseVecMat(sdpcone::SDPConeT, blockj::Integer, vari::Integer, n::Integer, alpha::Cdouble, ishift::Integer, ind::Union{Ptr{Cint},Vector{Cint}}, val::Union{Ptr{Cdouble},Vector{Cdouble}}, nnz::Integer)
49+
@dsdp_ccall SDPConeSetASparseVecMat (SDPConeT, Cint, Cint, Cint, Cdouble, Cint, Ptr{Cint}, Ptr{Cdouble}, Cint) sdpcone blockj vari n alpha ishift ind val nnz
4650
end
4751

48-
function SetADenseVecMat(sdpcone::SDPConeT, arg2::Integer, arg3::Integer, arg4::Integer, arg5::Cdouble, arg6, arg7::Integer)
52+
function SetADenseVecMat(sdpcone::SDPConeT, arg2::Integer, arg3::Integer, arg4::Integer, arg5::Cdouble, arg6::Vector{Cdouble}, arg7::Integer)
4953
@dsdp_ccall SDPConeSetADenseVecMat (SDPConeT, Cint, Cint, Cint, Cdouble, Ptr{Cdouble}, Cint) sdpcone arg2 arg3 arg4 arg5 arg6 arg7
5054
end
5155

52-
function SetARankOneMat(sdpcone::SDPConeT, arg2::Integer, arg3::Integer, arg4::Integer, arg5::Cdouble, arg6::Integer, arg7, arg8, arg9::Integer)
56+
function SetARankOneMat(sdpcone::SDPConeT, arg2::Integer, arg3::Integer, arg4::Integer, arg5::Cdouble, arg6::Integer, arg7::Vector{Cint}, arg8::Vector{Cdouble}, arg9::Integer)
5357
@dsdp_ccall SDPConeSetARankOneMat (SDPConeT, Cint, Cint, Cint, Cdouble, Cint, Ptr{Cint}, Ptr{Cdouble}, Cint) sdpcone arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9
5458
end
5559

@@ -73,11 +77,11 @@ function MatrixView(sdpcone::SDPConeT, arg2::Integer)
7377
@dsdp_ccall SDPConeMatrixView (SDPConeT, Cint) sdpcone arg2
7478
end
7579

76-
function AddASparseVecMat(sdpcone::SDPConeT, arg2::Integer, arg3::Integer, arg4::Integer, arg5::Cdouble, arg6::Integer, arg7, arg8, arg9::Integer)
80+
function AddASparseVecMat(sdpcone::SDPConeT, arg2::Integer, arg3::Integer, arg4::Integer, arg5::Cdouble, arg6::Integer, arg7::Union{Ptr{Cint},Vector{Cint}}, arg8::Union{Ptr{Cdouble},Vector{Cdouble}}, arg9::Integer)
7781
@dsdp_ccall SDPConeAddASparseVecMat (SDPConeT, Cint, Cint, Cint, Cdouble, Cint, Ptr{Cint}, Ptr{Cdouble}, Cint) sdpcone arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9
7882
end
7983

80-
function AddADenseVecMat(sdpcone::SDPConeT, arg2::Integer, arg3::Integer, arg4::Integer, arg5::Cdouble, arg6, arg7::Integer)
84+
function AddADenseVecMat(sdpcone::SDPConeT, arg2::Integer, arg3::Integer, arg4::Integer, arg5::Cdouble, arg6::Vector{Cdouble}, arg7::Integer)
8185
@dsdp_ccall SDPConeAddADenseVecMat (SDPConeT, Cint, Cint, Cint, Cdouble, Ptr{Cdouble}, Cint) sdpcone arg2 arg3 arg4 arg5 arg6 arg7
8286
end
8387

@@ -89,39 +93,42 @@ function AddIdentity(sdpcone::SDPConeT, arg2::Integer, arg3::Integer, arg4::Inte
8993
@dsdp_ccall SDPConeAddIdentity (SDPConeT, Cint, Cint, Cint, Cdouble) sdpcone arg2 arg3 arg4 arg5
9094
end
9195

92-
function AddARankOneMat(sdpcone::SDPConeT, arg2::Integer, arg3::Integer, arg4::Integer, arg5::Cdouble, arg6::Integer, arg7, arg8, arg9::Integer)
96+
function AddARankOneMat(sdpcone::SDPConeT, arg2::Integer, arg3::Integer, arg4::Integer, arg5::Cdouble, arg6::Integer, arg7::Vector{Cint}, arg8::Vector{Cdouble}, arg9::Integer)
9397
@dsdp_ccall SDPConeAddARankOneMat (SDPConeT, Cint, Cint, Cint, Cdouble, Cint, Ptr{Cint}, Ptr{Cdouble}, Cint) sdpcone arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9
9498
end
9599

96-
function AddSparseVecMat(sdpcone::SDPConeT, arg2::Integer, arg3::Integer, arg4::Integer, arg5::Integer, arg6, arg7, arg8::Integer)
100+
function AddSparseVecMat(sdpcone::SDPConeT, arg2::Integer, arg3::Integer, arg4::Integer, arg5::Integer, arg6::Vector{Cint}, arg7::Vector{Cdouble}, arg8::Integer)
97101
@dsdp_ccall SDPConeAddSparseVecMat (SDPConeT, Cint, Cint, Cint, Cint, Ptr{Cint}, Ptr{Cdouble}, Cint) sdpcone arg2 arg3 arg4 arg5 arg6 arg7 arg8
98102
end
99103

100-
function AddDenseVecMat(sdpcone::SDPConeT, arg2::Integer, arg3::Integer, arg4::Integer, arg5, arg6::Integer)
104+
function AddDenseVecMat(sdpcone::SDPConeT, arg2::Integer, arg3::Integer, arg4::Integer, arg5::Vector{Cdouble}, arg6::Integer)
101105
@dsdp_ccall SDPConeAddDenseVecMat (SDPConeT, Cint, Cint, Cint, Ptr{Cdouble}, Cint) sdpcone arg2 arg3 arg4 arg5 arg6
102106
end
103107

104-
function SetSparseVecMat(sdpcone::SDPConeT, arg2::Integer, arg3::Integer, arg4::Integer, arg5::Integer, arg6, arg7, arg8::Integer)
108+
function SetSparseVecMat(sdpcone::SDPConeT, arg2::Integer, arg3::Integer, arg4::Integer, arg5::Integer, arg6::Vector{Cint}, arg7::Vector{Cdouble}, arg8::Integer)
105109
@dsdp_ccall SDPConeSetSparseVecMat (SDPConeT, Cint, Cint, Cint, Cint, Ptr{Cint}, Ptr{Cdouble}, Cint) sdpcone arg2 arg3 arg4 arg5 arg6 arg7 arg8
106110
end
107111

108-
function SetDenseVecMat(sdpcone::SDPConeT, arg2::Integer, arg3::Integer, arg4::Integer, arg5, arg6::Integer)
112+
function SetDenseVecMat(sdpcone::SDPConeT, arg2::Integer, arg3::Integer, arg4::Integer, arg5::Vector{Cdouble}, arg6::Integer)
109113
@dsdp_ccall SDPConeSetDenseVecMat (SDPConeT, Cint, Cint, Cint, Ptr{Cdouble}, Cint) sdpcone arg2 arg3 arg4 arg5 arg6
110114
end
111115

112116
function SetXMat(sdpcone::SDPConeT, arg2::Integer, arg3::Integer)
113117
@dsdp_ccall SDPConeSetXMat (SDPConeT, Cint, Cint) sdpcone arg2 arg3
114118
end
115119

116-
function SetXArray(sdpcone::SDPConeT, arg2::Integer, arg3::Integer, arg4, arg5::Integer)
120+
function SetXArray(sdpcone::SDPConeT, arg2::Integer, arg3::Integer, arg4::Vector{Cdouble}, arg5::Integer)
117121
@dsdp_ccall SDPConeSetXArray (SDPConeT, Cint, Cint, Ptr{Cdouble}, Cint) sdpcone arg2 arg3 arg4 arg5
118122
end
119123

120-
function GetXArray(sdpcone::SDPConeT, arg2::Integer, arg3, arg4)
121-
@dsdp_ccall SDPConeGetXArray (SDPConeT, Cint, Ptr{Ptr{Cdouble}}, Ptr{Cint}) sdpcone arg2 arg3 arg4
124+
function GetXArray(sdpcone::SDPConeT, blockj::Integer)
125+
xmat = Ref{Ptr{Cdouble}}()
126+
nn = Ref{Cint}()
127+
@dsdp_ccall SDPConeGetXArray (SDPConeT, Cint, Ref{Ptr{Cdouble}}, Ref{Cint}) sdpcone blockj xmat nn
128+
unsafe_wrap(Array, xmat[], nn[])
122129
end
123130

124-
function RestoreXArray(sdpcone::SDPConeT, arg2::Integer, arg3, arg4)
131+
function RestoreXArray(sdpcone::SDPConeT, arg2::Integer, arg3, arg4::Vector{Cint})
125132
@dsdp_ccall SDPConeRestoreXArray (SDPConeT, Cint, Ptr{Ptr{Cdouble}}, Ptr{Cint}) sdpcone arg2 arg3 arg4
126133
end
127134

@@ -133,23 +140,27 @@ function RemoveDataMatrix(sdpcone::SDPConeT, arg2::Integer, arg3::Integer)
133140
@dsdp_ccall SDPConeRemoveDataMatrix (SDPConeT, Cint, Cint) sdpcone arg2 arg3
134141
end
135142

136-
function GetNumberOfBlocks(sdpcone::SDPConeT, arg2)
137-
@dsdp_ccall SDPConeGetNumberOfBlocks (SDPConeT, Ptr{Cint}) sdpcone arg2
143+
function GetNumberOfBlocks(sdpcone::SDPConeT)
144+
num = Ref{Cint}()
145+
@dsdp_ccall SDPConeGetNumberOfBlocks (SDPConeT, Ref{Cint}) sdpcone num
146+
return num[]
138147
end
139148

140-
function ComputeS(sdpcone::SDPConeT, arg2::Integer, arg3::Cdouble, arg4, arg5::Integer, arg6::Cdouble, arg7::Integer, arg8, arg9::Integer)
149+
function ComputeS(sdpcone::SDPConeT, arg2::Integer, arg3::Cdouble, arg4, arg5::Integer, arg6::Cdouble, arg7::Integer, arg8::Vector{Cdouble}, arg9::Integer)
141150
@dsdp_ccall SDPConeComputeS (SDPConeT, Cint, Cdouble, Ptr{Cdouble}, Cint, Cdouble, Cint, Ptr{Cdouble}, Cint) sdpcone arg2 arg3 arg4 arg5 arg6 arg7 arg8 arg9
142151
end
143152

144-
function ComputeX(sdpcone::SDPConeT, arg2::Integer, arg3::Integer, arg4, arg5::Integer)
145-
@dsdp_ccall SDPConeComputeX (SDPConeT, Cint, Cint, Ptr{Cdouble}, Cint) sdpcone arg2 arg3 arg4 arg5
153+
function ComputeX(sdpcone::SDPConeT, blockj::Integer, n::Integer, nn::Integer)
154+
xmat = zeros(Cdouble, nn)
155+
@dsdp_ccall SDPConeComputeX (SDPConeT, Cint, Cint, Ptr{Cdouble}, Cint) sdpcone blockj n xmat nn
156+
return xmat
146157
end
147158

148-
function AddADotX(sdpcone::SDPConeT, arg2::Integer, arg3::Cdouble, arg4, arg5::Integer, arg6, arg7::Integer)
159+
function AddADotX(sdpcone::SDPConeT, arg2::Integer, arg3::Cdouble, arg4::Vector{Cdouble}, arg5::Integer, arg6::Vector{Cdouble}, arg7::Integer)
149160
@dsdp_ccall SDPConeAddADotX (SDPConeT, Cint, Cdouble, Ptr{Cdouble}, Cint, Ptr{Cdouble}, Cint) sdpcone arg2 arg3 arg4 arg5 arg6 arg7
150161
end
151162

152-
function ViewX(sdpcone::SDPConeT, arg2::Integer, arg3::Integer, arg4, arg5::Integer)
163+
function ViewX(sdpcone::SDPConeT, arg2::Integer, arg3::Integer, arg4::Vector{Cdouble}, arg5::Integer)
153164
@dsdp_ccall SDPConeViewX (SDPConeT, Cint, Cint, Ptr{Cdouble}, Cint) sdpcone arg2 arg3 arg4 arg5
154165
end
155166

@@ -161,7 +172,7 @@ function ScaleBarrier(sdpcone::SDPConeT, arg2::Integer, arg3::Cdouble)
161172
@dsdp_ccall SDPConeScaleBarrier (SDPConeT, Cint, Cdouble) sdpcone arg2 arg3
162173
end
163174

164-
function XVMultiply(sdpcone::SDPConeT, arg2::Integer, arg3::Vector, arg4::Vector)
175+
function XVMultiply(sdpcone::SDPConeT, arg2::Integer, arg3::Vector{Cdouble}, arg4::Vector{Cdouble})
165176
n = length(arg3)
166177
@assert n == length(arg4)
167178
@dsdp_ccall SDPConeXVMultiply (SDPConeT, Cint, Ptr{Cdouble}, Ptr{Cdouble}, Cint) sdpcone arg2 pointer(arg3) pointer(arg4) n
@@ -173,7 +184,7 @@ function ComputeXV(sdpcone::SDPConeT, arg2::Integer)
173184
derror[]
174185
end
175186

176-
function AddXVAV(sdpcone::SDPConeT, arg2::Integer, arg3::Vector, arg5::Vector)
187+
function AddXVAV(sdpcone::SDPConeT, arg2::Integer, arg3::Vector{Cdouble}, arg5::Vector{Cdouble})
177188
@dsdp_ccall SDPConeAddXVAV (SDPConeT, Cint, Ptr{Cdouble}, Cint, Ptr{Cdouble}, Cint) sdpcone arg2 pointer(arg3) length(arg3) pointer(arg5) length(arg5)
178189
end
179190

0 commit comments

Comments
 (0)