@@ -9,16 +9,20 @@ function SetBlockSize(sdpcone::SDPConeT, i::Integer, j::Integer)
99 @dsdp_ccall SDPConeSetBlockSize (SDPConeT, Cint, Cint) sdpcone i j
1010end
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[]
1416end
1517
1618function SetStorageFormat (sdpcone:: SDPConeT , arg2:: Integer , arg3:: UInt8 )
1719 @dsdp_ccall SDPConeSetStorageFormat (SDPConeT, Cint, UInt8) sdpcone arg2 arg3
1820end
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[]
2226end
2327
2428function CheckStorageFormat (sdpcone:: SDPConeT , arg2:: Integer , arg3:: UInt8 )
@@ -41,15 +45,15 @@ function View3(sdpcone::SDPConeT)
4145 @dsdp_ccall SDPConeView3 (SDPConeT,) sdpcone
4246end
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
4650end
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
5054end
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
5458end
5559
@@ -73,11 +77,11 @@ function MatrixView(sdpcone::SDPConeT, arg2::Integer)
7377 @dsdp_ccall SDPConeMatrixView (SDPConeT, Cint) sdpcone arg2
7478end
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
7882end
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
8286end
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
9094end
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
9498end
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
98102end
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
102106end
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
106110end
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
110114end
111115
112116function SetXMat (sdpcone:: SDPConeT , arg2:: Integer , arg3:: Integer )
113117 @dsdp_ccall SDPConeSetXMat (SDPConeT, Cint, Cint) sdpcone arg2 arg3
114118end
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
118122end
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[])
122129end
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
126133end
127134
@@ -133,23 +140,27 @@ function RemoveDataMatrix(sdpcone::SDPConeT, arg2::Integer, arg3::Integer)
133140 @dsdp_ccall SDPConeRemoveDataMatrix (SDPConeT, Cint, Cint) sdpcone arg2 arg3
134141end
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[]
138147end
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
142151end
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
146157end
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
150161end
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
154165end
155166
@@ -161,7 +172,7 @@ function ScaleBarrier(sdpcone::SDPConeT, arg2::Integer, arg3::Cdouble)
161172 @dsdp_ccall SDPConeScaleBarrier (SDPConeT, Cint, Cdouble) sdpcone arg2 arg3
162173end
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[]
174185end
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)
178189end
179190
0 commit comments