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
Copy file name to clipboardExpand all lines: src/ECOS.jl
+93-10Lines changed: 93 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -104,8 +104,8 @@ immutable Cstats
104
104
nitref3::Clong
105
105
tsetup::Cdouble
106
106
tsolve::Cdouble
107
-
tfactor::Cdouble
108
-
tkktsolve::Cdouble
107
+
tfactor::Cdouble
108
+
tkktsolve::Cdouble
109
109
torder::Cdouble
110
110
tkktcreate::Cdouble
111
111
ttranspose::Cdouble
@@ -121,6 +121,9 @@ immutable Csettings
121
121
feastol::Cdouble
122
122
abstol::Cdouble
123
123
reltol::Cdouble
124
+
feastol_inacc::Cdouble
125
+
abstol_inacc::Cdouble
126
+
reltol_inacc::Cdouble
124
127
nitref::Clong
125
128
maxit::Clong
126
129
verbose::Clong
@@ -132,6 +135,7 @@ immutable Cpwork
132
135
m::Clong
133
136
p::Clong
134
137
D::Clong
138
+
135
139
# Variables
136
140
x::Ptr{Cdouble}
137
141
y::Ptr{Cdouble}
@@ -140,23 +144,45 @@ immutable Cpwork
140
144
lambda::Ptr{Cdouble}
141
145
kap::Cdouble
142
146
tau::Cdouble
147
+
148
+
# Best iterates seen so far
149
+
best_x::Ptr{Cdouble}
150
+
best_y::Ptr{Cdouble}
151
+
best_z::Ptr{Cdouble}
152
+
best_s::Ptr{Cdouble}
153
+
best_kap::Cdouble
154
+
best_tau::Cdouble
155
+
best_cx::Cdouble
156
+
best_by::Cdouble
157
+
best_hz::Cdouble
158
+
best_info::Ptr{Cstats}
159
+
143
160
# Temporary variables
144
161
dsaff::Ptr{Cdouble}
145
162
dzaff::Ptr{Cdouble}
146
163
W_times_dzaff::Ptr{Cdouble}
164
+
dsaff_by_W::Ptr{Cdouble}
147
165
saff::Ptr{Cdouble}
148
166
zaff::Ptr{Cdouble}
167
+
149
168
# Cone
150
169
C::Ptr{Ccone}
151
170
A::Ptr{Cspmat}
152
171
G::Ptr{Cspmat}
153
172
c::Ptr{Cdouble}
154
173
b::Ptr{Cdouble}
155
174
h::Ptr{Cdouble}
175
+
176
+
# equilibration vector
177
+
xequil::Ptr{Cdouble}
178
+
Aequil::Ptr{Cdouble}
179
+
Gequil::Ptr{Cdouble}
180
+
156
181
# scalings of problem data
157
182
resx0::Cdouble
158
183
resy0::Cdouble
159
184
resz0::Cdouble
185
+
160
186
# residuals
161
187
rx::Ptr{Cdouble}
162
188
ry::Ptr{Cdouble}
@@ -165,21 +191,25 @@ immutable Cpwork
165
191
hresx::Cdouble
166
192
hresy::Cdouble
167
193
hresz::Cdouble
168
-
# temporary storage
194
+
195
+
# temporary storage
169
196
cx::Cdouble
170
197
by::Cdouble
171
198
hz::Cdouble
172
199
sz::Cdouble
200
+
173
201
# KKT System
174
202
KKT::Ptr{Ckkt}
203
+
175
204
# info struct
176
205
info::Ptr{Cstats}
206
+
177
207
# settings struct
178
208
stgs::Ptr{Csettings}
179
209
end
180
210
181
211
182
-
# ECOS types:
212
+
# ECOS types:
183
213
# pfloat -> Cdouble
184
214
# idxint -> SuiteSparse_long -> Clong
185
215
@@ -190,18 +220,71 @@ end
190
220
# l is the dimension of the positive orthant, i.e. in Gx+s=h, s in K, the first l elements of s are >=0
191
221
# ncones is the number of second-order cones present in K
192
222
# q is an array of integers of length ncones, where each element defines the dimension of the cone
193
-
# Gpr, Gjc, Gir are the the data, the column index, and the row index arrays, respectively, for the matrix G represented in column compressed storage (CCS) format (Google it if you need more information on this format, it is one of the standard sparse matrix representations)
223
+
# Gpr, Gjc, Gir are the the data, the column index, and the row index arrays, respectively,
224
+
# for the matrix G represented in column compressed storage (CCS) format (Google it if you need more
225
+
# information on this format, it is one of the standard sparse matrix representations)
194
226
# Apr, Ajc, Air is the CCS representation of the matrix A (can be all NULL if no equalities are present)
195
227
# c is an array of type pfloat of size n
196
228
# h is an array of type pfloat of size m
229
+
# b is an array of type pfloat of size p (can be NULL if no equalities are present)
230
+
# The setup function returns a struct of type pwork, which you need to define first
231
+
# This is the straightforward translation from the C API.
problem =ccall((:ECOS_setup, ECOS.ecos), Ptr{Cpwork}, (Clong, Clong, Clong, Clong, Clong, Ptr{Clong}, Ptr{Cdouble}, Ptr{Clong}, Ptr{Clong}, Ptr{Cdouble}, Ptr{Clong}, Ptr{Clong}, Ptr{Cdouble}, Ptr{Cdouble}, Ptr{Cdouble}), n, m, p, l, ncones, q, Gpr, Gjc, Gir, Apr, Ajc, Air, c, h, b)
237
+
end
197
238
198
-
# b is an array of type pfloat of size p (can be NULL if no equalities are present) The setup function returns a struct of type pwork, which you need to define first
0 commit comments