1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
/* automatically generated by rust-bindgen */

use {c_float, c_int, OSQPTimer};

pub const QDLDL_SOLVER: linsys_solver_type = 0;
pub const MKL_PARDISO_SOLVER: linsys_solver_type = 1;
#[doc = " Linear System Solvers *"]
pub type linsys_solver_type = u32;
pub const OSQP_DATA_VALIDATION_ERROR: osqp_error_type = 1;
pub const OSQP_SETTINGS_VALIDATION_ERROR: osqp_error_type = 2;
pub const OSQP_LINSYS_SOLVER_LOAD_ERROR: osqp_error_type = 3;
pub const OSQP_LINSYS_SOLVER_INIT_ERROR: osqp_error_type = 4;
pub const OSQP_NONCVX_ERROR: osqp_error_type = 5;
pub const OSQP_MEM_ALLOC_ERROR: osqp_error_type = 6;
pub const OSQP_WORKSPACE_NOT_INIT_ERROR: osqp_error_type = 7;
#[doc = " Solver Errors  *"]
pub type osqp_error_type = u32;
#[doc = "  Matrix in compressed-column form."]
#[doc = "  The structure is used internally to store matrices in the triplet form as well,"]
#[doc = "  but the API requires that the matrices are in the CSC format."]
#[repr(C)]
pub struct csc {
    #[doc = "< maximum number of entries"]
    pub nzmax: c_int,
    #[doc = "< number of rows"]
    pub m: c_int,
    #[doc = "< number of columns"]
    pub n: c_int,
    #[doc = "< column pointers (size n+1); col indices (size nzmax) start from 0 when using triplet format (direct KKT matrix formation)"]
    pub p: *mut c_int,
    #[doc = "< row indices, size nzmax starting from 0"]
    pub i: *mut c_int,
    #[doc = "< numerical values, size nzmax"]
    pub x: *mut c_float,
    #[doc = "< number of entries in triplet matrix, -1 for csc"]
    pub nz: c_int,
}
#[doc = " Linear system solver structure (sublevel objects initialize it differently)"]
pub type LinSysSolver = linsys_solver;
#[doc = " Problem scaling matrices stored as vectors"]
#[repr(C)]
pub struct OSQPScaling {
    #[doc = "< cost function scaling"]
    pub c: c_float,
    #[doc = "< primal variable scaling"]
    pub D: *mut c_float,
    #[doc = "< dual variable scaling"]
    pub E: *mut c_float,
    #[doc = "< cost function rescaling"]
    pub cinv: c_float,
    #[doc = "< primal variable rescaling"]
    pub Dinv: *mut c_float,
    #[doc = "< dual variable rescaling"]
    pub Einv: *mut c_float,
}
#[doc = " Solution structure"]
#[repr(C)]
#[derive(Debug, Copy, Clone)]
pub struct OSQPSolution {
    #[doc = "< primal solution"]
    pub x: *mut c_float,
    #[doc = "< Lagrange multiplier associated to \\f$l <= Ax <= u\\f$"]
    pub y: *mut c_float,
}
#[doc = " Solver return information"]
#[repr(C)]
pub struct OSQPInfo {
    #[doc = "< number of iterations taken"]
    pub iter: c_int,
    #[doc = "< status string, e.g. 'solved'"]
    pub status: [::std::os::raw::c_char; 32usize],
    #[doc = "< status as c_int, defined in constants.h"]
    pub status_val: c_int,
    #[doc = "< polish status: successful (1), unperformed (0), (-1) unsuccessful"]
    pub status_polish: c_int,
    #[doc = "< primal objective"]
    pub obj_val: c_float,
    #[doc = "< norm of primal residual"]
    pub pri_res: c_float,
    #[doc = "< norm of dual residual"]
    pub dua_res: c_float,
    #[doc = "< time taken for setup phase (seconds)"]
    pub setup_time: c_float,
    #[doc = "< time taken for solve phase (seconds)"]
    pub solve_time: c_float,
    #[doc = "< time taken for update phase (seconds)"]
    pub update_time: c_float,
    #[doc = "< time taken for polish phase (seconds)"]
    pub polish_time: c_float,
    #[doc = "< total time  (seconds)"]
    pub run_time: c_float,
    #[doc = "< number of rho updates"]
    pub rho_updates: c_int,
    #[doc = "< best rho estimate so far from residuals"]
    pub rho_estimate: c_float,
}
#[doc = " Polish structure"]
#[repr(C)]
pub struct OSQPPolish {
    #[doc = "< active rows of A"]
    #[doc = "<    Ared = vstack[Alow, Aupp]"]
    pub Ared: *mut csc,
    #[doc = "< number of lower-active rows"]
    pub n_low: c_int,
    #[doc = "< number of upper-active rows"]
    pub n_upp: c_int,
    #[doc = "< Maps indices in A to indices in Alow"]
    pub A_to_Alow: *mut c_int,
    #[doc = "< Maps indices in A to indices in Aupp"]
    pub A_to_Aupp: *mut c_int,
    #[doc = "< Maps indices in Alow to indices in A"]
    pub Alow_to_A: *mut c_int,
    #[doc = "< Maps indices in Aupp to indices in A"]
    pub Aupp_to_A: *mut c_int,
    #[doc = "< optimal x-solution obtained by polish"]
    pub x: *mut c_float,
    #[doc = "< optimal z-solution obtained by polish"]
    pub z: *mut c_float,
    #[doc = "< optimal y-solution obtained by polish"]
    pub y: *mut c_float,
    #[doc = "< objective value at polished solution"]
    pub obj_val: c_float,
    #[doc = "< primal residual at polished solution"]
    pub pri_res: c_float,
    #[doc = "< dual residual at polished solution"]
    pub dua_res: c_float,
}
#[doc = " Data structure"]
#[repr(C)]
pub struct OSQPData {
    #[doc = "< number of variables n"]
    pub n: c_int,
    #[doc = "< number of constraints m"]
    pub m: c_int,
    #[doc = "< the upper triangular part of the quadratic cost matrix P in csc format (size n x n)."]
    pub P: *mut csc,
    #[doc = "< linear constraints matrix A in csc format (size m x n)"]
    pub A: *mut csc,
    #[doc = "< dense array for linear part of cost function (size n)"]
    pub q: *mut c_float,
    #[doc = "< dense array for lower bound (size m)"]
    pub l: *mut c_float,
    #[doc = "< dense array for upper bound (size m)"]
    pub u: *mut c_float,
}
#[doc = " Settings struct"]
#[repr(C)]
pub struct OSQPSettings {
    #[doc = "< ADMM step rho"]
    pub rho: c_float,
    #[doc = "< ADMM step sigma"]
    pub sigma: c_float,
    #[doc = "< heuristic data scaling iterations; if 0, then disabled."]
    pub scaling: c_int,
    #[doc = "< boolean, is rho step size adaptive?"]
    pub adaptive_rho: c_int,
    #[doc = "< number of iterations between rho adaptations; if 0, then it is automatic"]
    pub adaptive_rho_interval: c_int,
    #[doc = "< tolerance X for adapting rho. The new rho has to be X times larger or 1/X times smaller than the current one to trigger a new factorization."]
    pub adaptive_rho_tolerance: c_float,
    #[doc = "< interval for adapting rho (fraction of the setup time)"]
    pub adaptive_rho_fraction: c_float,
    #[doc = "< maximum number of iterations"]
    pub max_iter: c_int,
    #[doc = "< absolute convergence tolerance"]
    pub eps_abs: c_float,
    #[doc = "< relative convergence tolerance"]
    pub eps_rel: c_float,
    #[doc = "< primal infeasibility tolerance"]
    pub eps_prim_inf: c_float,
    #[doc = "< dual infeasibility tolerance"]
    pub eps_dual_inf: c_float,
    #[doc = "< relaxation parameter"]
    pub alpha: c_float,
    #[doc = "< linear system solver to use"]
    pub linsys_solver: linsys_solver_type,
    #[doc = "< regularization parameter for polishing"]
    pub delta: c_float,
    #[doc = "< boolean, polish ADMM solution"]
    pub polish: c_int,
    #[doc = "< number of iterative refinement steps in polishing"]
    pub polish_refine_iter: c_int,
    #[doc = "< boolean, write out progress"]
    pub verbose: c_int,
    #[doc = "< boolean, use scaled termination criteria"]
    pub scaled_termination: c_int,
    #[doc = "< integer, check termination interval; if 0, then termination checking is disabled"]
    pub check_termination: c_int,
    #[doc = "< boolean, warm start"]
    pub warm_start: c_int,
    #[doc = "< maximum number of seconds allowed to solve the problem; if 0, then disabled"]
    pub time_limit: c_float,
}
#[doc = " OSQP Workspace"]
#[repr(C)]
pub struct OSQPWorkspace {
    #[doc = " Problem data to work on (possibly scaled)"]
    pub data: *mut OSQPData,
    #[doc = " Linear System solver structure"]
    pub linsys_solver: *mut LinSysSolver,
    #[doc = " Polish structure"]
    pub pol: *mut OSQPPolish,
    #[doc = "< vector of rho values"]
    pub rho_vec: *mut c_float,
    #[doc = "< vector of inv rho values"]
    pub rho_inv_vec: *mut c_float,
    #[doc = "< Type of constraints: loose (-1), equality (1), inequality (0)"]
    pub constr_type: *mut c_int,
    #[doc = "< Iterate x"]
    pub x: *mut c_float,
    #[doc = "< Iterate y"]
    pub y: *mut c_float,
    #[doc = "< Iterate z"]
    pub z: *mut c_float,
    #[doc = "< Iterate xz_tilde"]
    pub xz_tilde: *mut c_float,
    #[doc = "< Previous x"]
    pub x_prev: *mut c_float,
    #[doc = "< Previous z"]
    pub z_prev: *mut c_float,
    #[doc = "< scaled A * x"]
    pub Ax: *mut c_float,
    #[doc = "< scaled P * x"]
    pub Px: *mut c_float,
    #[doc = "< scaled A' * y"]
    pub Aty: *mut c_float,
    #[doc = "< difference between consecutive dual iterates"]
    pub delta_y: *mut c_float,
    #[doc = "< A' * delta_y"]
    pub Atdelta_y: *mut c_float,
    #[doc = "< difference between consecutive primal iterates"]
    pub delta_x: *mut c_float,
    #[doc = "< P * delta_x"]
    pub Pdelta_x: *mut c_float,
    #[doc = "< A * delta_x"]
    pub Adelta_x: *mut c_float,
    #[doc = "< temporary primal variable scaling vectors"]
    pub D_temp: *mut c_float,
    #[doc = "< temporary primal variable scaling vectors storing norms of A columns"]
    pub D_temp_A: *mut c_float,
    #[doc = "< temporary constraints scaling vectors storing norms of A' columns"]
    pub E_temp: *mut c_float,
    #[doc = "< problem settings"]
    pub settings: *mut OSQPSettings,
    #[doc = "< scaling vectors"]
    pub scaling: *mut OSQPScaling,
    #[doc = "< problem solution"]
    pub solution: *mut OSQPSolution,
    #[doc = "< solver information"]
    pub info: *mut OSQPInfo,
    #[doc = "< timer object"]
    pub timer: *mut OSQPTimer,
    #[doc = " flag indicating whether the solve function has been run before"]
    pub first_run: c_int,
    #[doc = " flag indicating whether the update_time should be cleared"]
    pub clear_update_time: c_int,
    #[doc = " flag indicating that osqp_update_rho is called from osqp_solve function"]
    pub rho_update_from_solve: c_int,
    #[doc = "< Has last summary been printed? (true/false)"]
    pub summary_printed: c_int,
}
#[doc = " Define linsys_solver prototype structure"]
#[doc = ""]
#[doc = " NB: The details are defined when the linear solver is initialized depending"]
#[doc = "      on the choice"]
#[repr(C)]
pub struct linsys_solver {
    #[doc = "< linear system solver type functions"]
    pub type_: linsys_solver_type,
    pub solve: ::std::option::Option<
        unsafe extern "C" fn(self_: *mut LinSysSolver, b: *mut c_float) -> c_int,
    >,
    #[doc = "< free linear system solver (only in desktop version)"]
    pub free: ::std::option::Option<unsafe extern "C" fn(self_: *mut LinSysSolver)>,
    pub update_matrices: ::std::option::Option<
        unsafe extern "C" fn(s: *mut LinSysSolver, P: *const csc, A: *const csc) -> c_int,
    >,
    pub update_rho_vec: ::std::option::Option<
        unsafe extern "C" fn(s: *mut LinSysSolver, rho_vec: *const c_float) -> c_int,
    >,
    #[doc = "< number of threads active"]
    pub nthreads: c_int,
}
extern "C" {
    #[doc = " Set default settings from constants.h file"]
    #[doc = " assumes settings already allocated in memory"]
    #[doc = " @param settings settings structure"]
    pub fn osqp_set_default_settings(settings: *mut OSQPSettings);
}
extern "C" {
    #[doc = " Initialize OSQP solver allocating memory."]
    #[doc = ""]
    #[doc = " All the inputs must be already allocated in memory before calling."]
    #[doc = ""]
    #[doc = " It performs:"]
    #[doc = " - data and settings validation"]
    #[doc = " - problem data scaling"]
    #[doc = " - automatic parameters tuning (if enabled)"]
    #[doc = " - setup linear system solver:"]
    #[doc = "      - direct solver: KKT matrix factorization is performed here"]
    #[doc = "      - indirect solver: KKT matrix preconditioning is performed here"]
    #[doc = ""]
    #[doc = " NB: This is the only function that allocates dynamic memory and is not used"]
    #[doc = "during code generation"]
    #[doc = ""]
    #[doc = " @param  workp        Solver workspace pointer"]
    #[doc = " @param  data         Problem data"]
    #[doc = " @param  settings     Solver settings"]
    #[doc = " @return              Exitflag for errors (0 if no errors)"]
    pub fn osqp_setup(
        workp: *mut *mut OSQPWorkspace,
        data: *const OSQPData,
        settings: *const OSQPSettings,
    ) -> c_int;
}
extern "C" {
    #[doc = " Solve quadratic program"]
    #[doc = ""]
    #[doc = " The final solver information is stored in the \\a work->info  structure"]
    #[doc = ""]
    #[doc = " The solution is stored in the  \\a work->solution  structure"]
    #[doc = ""]
    #[doc = " If the problem is primal infeasible, the certificate is stored"]
    #[doc = " in \\a work->delta_y"]
    #[doc = ""]
    #[doc = " If the problem is dual infeasible, the certificate is stored in \\a"]
    #[doc = " work->delta_x"]
    #[doc = ""]
    #[doc = " @param  work Workspace allocated"]
    #[doc = " @return      Exitflag for errors"]
    pub fn osqp_solve(work: *mut OSQPWorkspace) -> c_int;
}
extern "C" {
    #[doc = " Cleanup workspace by deallocating memory"]
    #[doc = ""]
    #[doc = " This function is not used in code generation"]
    #[doc = " @param  work Workspace"]
    #[doc = " @return      Exitflag for errors"]
    pub fn osqp_cleanup(work: *mut OSQPWorkspace) -> c_int;
}
extern "C" {
    #[doc = " Update linear cost in the problem"]
    #[doc = " @param  work  Workspace"]
    #[doc = " @param  q_new New linear cost"]
    #[doc = " @return       Exitflag for errors and warnings"]
    pub fn osqp_update_lin_cost(work: *mut OSQPWorkspace, q_new: *const c_float) -> c_int;
}
extern "C" {
    #[doc = " Update lower and upper bounds in the problem constraints"]
    #[doc = " @param  work   Workspace"]
    #[doc = " @param  l_new New lower bound"]
    #[doc = " @param  u_new New upper bound"]
    #[doc = " @return        Exitflag: 1 if new lower bound is not <= than new upper bound"]
    pub fn osqp_update_bounds(
        work: *mut OSQPWorkspace,
        l_new: *const c_float,
        u_new: *const c_float,
    ) -> c_int;
}
extern "C" {
    #[doc = " Update lower bound in the problem constraints"]
    #[doc = " @param  work   Workspace"]
    #[doc = " @param  l_new New lower bound"]
    #[doc = " @return        Exitflag: 1 if new lower bound is not <= than upper bound"]
    pub fn osqp_update_lower_bound(work: *mut OSQPWorkspace, l_new: *const c_float) -> c_int;
}
extern "C" {
    #[doc = " Update upper bound in the problem constraints"]
    #[doc = " @param  work   Workspace"]
    #[doc = " @param  u_new New upper bound"]
    #[doc = " @return        Exitflag: 1 if new upper bound is not >= than lower bound"]
    pub fn osqp_update_upper_bound(work: *mut OSQPWorkspace, u_new: *const c_float) -> c_int;
}
extern "C" {
    #[doc = " Warm start primal and dual variables"]
    #[doc = " @param  work Workspace structure"]
    #[doc = " @param  x    Primal variable"]
    #[doc = " @param  y    Dual variable"]
    #[doc = " @return      Exitflag"]
    pub fn osqp_warm_start(work: *mut OSQPWorkspace, x: *const c_float, y: *const c_float)
        -> c_int;
}
extern "C" {
    #[doc = " Warm start primal variable"]
    #[doc = " @param  work Workspace structure"]
    #[doc = " @param  x    Primal variable"]
    #[doc = " @return      Exitflag"]
    pub fn osqp_warm_start_x(work: *mut OSQPWorkspace, x: *const c_float) -> c_int;
}
extern "C" {
    #[doc = " Warm start dual variable"]
    #[doc = " @param  work Workspace structure"]
    #[doc = " @param  y    Dual variable"]
    #[doc = " @return      Exitflag"]
    pub fn osqp_warm_start_y(work: *mut OSQPWorkspace, y: *const c_float) -> c_int;
}
extern "C" {
    #[doc = " Update elements of matrix P (upper triangular)"]
    #[doc = " without changing sparsity structure."]
    #[doc = ""]
    #[doc = ""]
    #[doc = "  If Px_new_idx is OSQP_NULL, Px_new is assumed to be as long as P->x"]
    #[doc = "  and the whole P->x is replaced."]
    #[doc = ""]
    #[doc = " @param  work       Workspace structure"]
    #[doc = " @param  Px_new     Vector of new elements in P->x (upper triangular)"]
    #[doc = " @param  Px_new_idx Index mapping new elements to positions in P->x"]
    #[doc = " @param  P_new_n    Number of new elements to be changed"]
    #[doc = " @return            output flag:  0: OK"]
    #[doc = "                                  1: P_new_n > nnzP"]
    #[doc = "                                 <0: error in the update"]
    pub fn osqp_update_P(
        work: *mut OSQPWorkspace,
        Px_new: *const c_float,
        Px_new_idx: *const c_int,
        P_new_n: c_int,
    ) -> c_int;
}
extern "C" {
    #[doc = " Update elements of matrix A without changing sparsity structure."]
    #[doc = ""]
    #[doc = ""]
    #[doc = "  If Ax_new_idx is OSQP_NULL, Ax_new is assumed to be as long as A->x"]
    #[doc = "  and the whole A->x is replaced."]
    #[doc = ""]
    #[doc = " @param  work       Workspace structure"]
    #[doc = " @param  Ax_new     Vector of new elements in A->x"]
    #[doc = " @param  Ax_new_idx Index mapping new elements to positions in A->x"]
    #[doc = " @param  A_new_n    Number of new elements to be changed"]
    #[doc = " @return            output flag:  0: OK"]
    #[doc = "                                  1: A_new_n > nnzA"]
    #[doc = "                                 <0: error in the update"]
    pub fn osqp_update_A(
        work: *mut OSQPWorkspace,
        Ax_new: *const c_float,
        Ax_new_idx: *const c_int,
        A_new_n: c_int,
    ) -> c_int;
}
extern "C" {
    #[doc = " Update elements of matrix P (upper triangular) and elements of matrix A"]
    #[doc = " without changing sparsity structure."]
    #[doc = ""]
    #[doc = ""]
    #[doc = "  If Px_new_idx is OSQP_NULL, Px_new is assumed to be as long as P->x"]
    #[doc = "  and the whole P->x is replaced."]
    #[doc = ""]
    #[doc = "  If Ax_new_idx is OSQP_NULL, Ax_new is assumed to be as long as A->x"]
    #[doc = "  and the whole A->x is replaced."]
    #[doc = ""]
    #[doc = " @param  work       Workspace structure"]
    #[doc = " @param  Px_new     Vector of new elements in P->x (upper triangular)"]
    #[doc = " @param  Px_new_idx Index mapping new elements to positions in P->x"]
    #[doc = " @param  P_new_n    Number of new elements to be changed"]
    #[doc = " @param  Ax_new     Vector of new elements in A->x"]
    #[doc = " @param  Ax_new_idx Index mapping new elements to positions in A->x"]
    #[doc = " @param  A_new_n    Number of new elements to be changed"]
    #[doc = " @return            output flag:  0: OK"]
    #[doc = "                                  1: P_new_n > nnzP"]
    #[doc = "                                  2: A_new_n > nnzA"]
    #[doc = "                                 <0: error in the update"]
    pub fn osqp_update_P_A(
        work: *mut OSQPWorkspace,
        Px_new: *const c_float,
        Px_new_idx: *const c_int,
        P_new_n: c_int,
        Ax_new: *const c_float,
        Ax_new_idx: *const c_int,
        A_new_n: c_int,
    ) -> c_int;
}
extern "C" {
    #[doc = " Update rho. Limit it between RHO_MIN and RHO_MAX."]
    #[doc = " @param  work         Workspace"]
    #[doc = " @param  rho_new      New rho setting"]
    #[doc = " @return              Exitflag"]
    pub fn osqp_update_rho(work: *mut OSQPWorkspace, rho_new: c_float) -> c_int;
}
extern "C" {
    #[doc = " Update max_iter setting"]
    #[doc = " @param  work         Workspace"]
    #[doc = " @param  max_iter_new New max_iter setting"]
    #[doc = " @return              Exitflag"]
    pub fn osqp_update_max_iter(work: *mut OSQPWorkspace, max_iter_new: c_int) -> c_int;
}
extern "C" {
    #[doc = " Update absolute tolernace value"]
    #[doc = " @param  work        Workspace"]
    #[doc = " @param  eps_abs_new New absolute tolerance value"]
    #[doc = " @return             Exitflag"]
    pub fn osqp_update_eps_abs(work: *mut OSQPWorkspace, eps_abs_new: c_float) -> c_int;
}
extern "C" {
    #[doc = " Update relative tolernace value"]
    #[doc = " @param  work        Workspace"]
    #[doc = " @param  eps_rel_new New relative tolerance value"]
    #[doc = " @return             Exitflag"]
    pub fn osqp_update_eps_rel(work: *mut OSQPWorkspace, eps_rel_new: c_float) -> c_int;
}
extern "C" {
    #[doc = " Update primal infeasibility tolerance"]
    #[doc = " @param  work          Workspace"]
    #[doc = " @param  eps_prim_inf_new  New primal infeasibility tolerance"]
    #[doc = " @return               Exitflag"]
    pub fn osqp_update_eps_prim_inf(work: *mut OSQPWorkspace, eps_prim_inf_new: c_float) -> c_int;
}
extern "C" {
    #[doc = " Update dual infeasibility tolerance"]
    #[doc = " @param  work          Workspace"]
    #[doc = " @param  eps_dual_inf_new  New dual infeasibility tolerance"]
    #[doc = " @return               Exitflag"]
    pub fn osqp_update_eps_dual_inf(work: *mut OSQPWorkspace, eps_dual_inf_new: c_float) -> c_int;
}
extern "C" {
    #[doc = " Update relaxation parameter alpha"]
    #[doc = " @param  work  Workspace"]
    #[doc = " @param  alpha_new New relaxation parameter value"]
    #[doc = " @return       Exitflag"]
    pub fn osqp_update_alpha(work: *mut OSQPWorkspace, alpha_new: c_float) -> c_int;
}
extern "C" {
    #[doc = " Update warm_start setting"]
    #[doc = " @param  work           Workspace"]
    #[doc = " @param  warm_start_new New warm_start setting"]
    #[doc = " @return                Exitflag"]
    pub fn osqp_update_warm_start(work: *mut OSQPWorkspace, warm_start_new: c_int) -> c_int;
}
extern "C" {
    #[doc = " Update scaled_termination setting"]
    #[doc = " @param  work                 Workspace"]
    #[doc = " @param  scaled_termination_new  New scaled_termination setting"]
    #[doc = " @return                      Exitflag"]
    pub fn osqp_update_scaled_termination(
        work: *mut OSQPWorkspace,
        scaled_termination_new: c_int,
    ) -> c_int;
}
extern "C" {
    #[doc = " Update check_termination setting"]
    #[doc = " @param  work                   Workspace"]
    #[doc = " @param  check_termination_new  New check_termination setting"]
    #[doc = " @return                        Exitflag"]
    pub fn osqp_update_check_termination(
        work: *mut OSQPWorkspace,
        check_termination_new: c_int,
    ) -> c_int;
}
extern "C" {
    #[doc = " Update regularization parameter in polish"]
    #[doc = " @param  work      Workspace"]
    #[doc = " @param  delta_new New regularization parameter"]
    #[doc = " @return           Exitflag"]
    pub fn osqp_update_delta(work: *mut OSQPWorkspace, delta_new: c_float) -> c_int;
}
extern "C" {
    #[doc = " Update polish setting"]
    #[doc = " @param  work          Workspace"]
    #[doc = " @param  polish_new New polish setting"]
    #[doc = " @return               Exitflag"]
    pub fn osqp_update_polish(work: *mut OSQPWorkspace, polish_new: c_int) -> c_int;
}
extern "C" {
    #[doc = " Update number of iterative refinement steps in polish"]
    #[doc = " @param  work                Workspace"]
    #[doc = " @param  polish_refine_iter_new New iterative reginement steps"]
    #[doc = " @return                     Exitflag"]
    pub fn osqp_update_polish_refine_iter(
        work: *mut OSQPWorkspace,
        polish_refine_iter_new: c_int,
    ) -> c_int;
}
extern "C" {
    #[doc = " Update verbose setting"]
    #[doc = " @param  work        Workspace"]
    #[doc = " @param  verbose_new New verbose setting"]
    #[doc = " @return             Exitflag"]
    pub fn osqp_update_verbose(work: *mut OSQPWorkspace, verbose_new: c_int) -> c_int;
}
extern "C" {
    #[doc = " Update time_limit setting"]
    #[doc = " @param  work            Workspace"]
    #[doc = " @param  time_limit_new  New time_limit setting"]
    #[doc = " @return                 Exitflag"]
    pub fn osqp_update_time_limit(work: *mut OSQPWorkspace, time_limit_new: c_float) -> c_int;
}
pub const OSQP_DUAL_INFEASIBLE_INACCURATE: ffi_osqp_solve_status = 4;
pub const OSQP_PRIMAL_INFEASIBLE_INACCURATE: ffi_osqp_solve_status = 3;
pub const OSQP_SOLVED_INACCURATE: ffi_osqp_solve_status = 2;
pub const OSQP_SOLVED: ffi_osqp_solve_status = 1;
pub const OSQP_MAX_ITER_REACHED: ffi_osqp_solve_status = -2;
pub const OSQP_PRIMAL_INFEASIBLE: ffi_osqp_solve_status = -3;
pub const OSQP_DUAL_INFEASIBLE: ffi_osqp_solve_status = -4;
pub const OSQP_SIGINT: ffi_osqp_solve_status = -5;
pub const OSQP_TIME_LIMIT_REACHED: ffi_osqp_solve_status = -6;
pub const OSQP_NON_CVX: ffi_osqp_solve_status = -7;
pub const OSQP_UNSOLVED: ffi_osqp_solve_status = -10;
pub type ffi_osqp_solve_status = i32;