grb_sys2/
lib.rs

1#![allow(non_camel_case_types)]
2#![allow(improper_ctypes)]
3
4pub use std::os::raw::{c_char, c_double, c_int, c_void};
5pub type c_str = *const c_char;
6
7#[repr(C)]
8pub struct GRBenv;
9
10#[repr(C)]
11pub struct GRBmodel;
12
13#[repr(C)]
14pub struct GRBsvec {
15    /// sparse vector length
16    pub len: c_int,
17    /// indices array of the sparse vector
18    pub ind: *mut c_int,
19    /// value array of the sparse vector
20    pub val: *mut c_double,
21}
22
23// Environment Creation and Destruction
24extern "C" {
25    pub fn GRBemptyenvinternal(
26        envP: *mut *mut GRBenv,
27        major: c_int,
28        minor: c_int,
29        tech: c_int,
30    ) -> c_int;
31
32    pub fn GRBstartenv(envP: *mut GRBenv) -> c_int;
33
34    pub fn GRBloadenvinternal(
35        envP: *mut *mut GRBenv,
36        logfilename: c_str,
37        major: c_int,
38        minor: c_int,
39        tech: c_int,
40    ) -> c_int;
41
42    pub fn GRBgetmultiobjenv(model: *mut GRBmodel, num: c_int) -> *mut GRBenv;
43
44    pub fn GRBdiscardmultiobjenvs(model: *mut GRBmodel);
45
46    pub fn GRBfreeenv(env: *mut GRBenv);
47
48    pub fn GRBgetconcurrentenv(model: *mut GRBmodel, num: c_int) -> *mut GRBenv;
49
50    pub fn GRBdiscardconcurrentenvs(model: *mut GRBmodel);
51}
52
53macro_rules! add_func_constr {
54    ($($fn_name:ident),+) => {$(
55        pub fn $fn_name(
56            model: *mut GRBmodel,
57            name: c_str,
58            xvar: c_int,
59            yvar: c_int,
60            options: c_str,
61        ) -> c_int; )+
62    };
63}
64
65macro_rules! add_funca_constr {
66    ($($fn_name:ident),+) => {$(
67        pub fn $fn_name(
68            model: *mut GRBmodel,
69            name: c_str,
70            xvar: c_int,
71            yvar: c_int,
72            a: c_double,
73            options: c_str,
74        ) -> c_int; )+
75    };
76}
77
78macro_rules! get_func_constr {
79    ($($fn_name:ident),+) => {$(
80        pub fn $fn_name(
81            model: *mut GRBmodel,
82            id: c_int,
83            xvarP: *mut c_int,
84            yvarP: *mut c_int,
85        ) -> c_int; )+
86    };
87}
88
89macro_rules! get_funca_constr {
90    ($($fn_name:ident),+) => {$(
91        pub fn $fn_name(
92            model: *mut GRBmodel,
93            id: c_int,
94            xvarP: *mut c_int,
95            yvarP: *mut c_int,
96            aP: *mut c_double,
97    ) -> c_int; )+
98    };
99}
100
101// Model Creation and Modification
102extern "C" {
103    pub fn GRBnewmodel(
104        env: *mut GRBenv,
105        modelP: *mut *mut GRBmodel,
106        Pname: c_str,
107        numvars: c_int,
108        obj: *const c_double,
109        lb: *const c_double,
110        ub: *const c_double,
111        vtype: *const c_char,
112        varnames: *const c_str,
113    ) -> c_int;
114
115    pub fn GRBcopymodel(model: *mut GRBmodel) -> *mut GRBmodel;
116
117    pub fn GRBaddconstr(
118        model: *mut GRBmodel,
119        numnz: c_int,
120        cind: *const c_int,
121        cval: *const c_double,
122        sense: c_char,
123        rhs: c_double,
124        constrname: c_str,
125    ) -> c_int;
126
127    pub fn GRBaddconstrs(
128        model: *mut GRBmodel,
129        numconstrs: c_int,
130        numnz: c_int,
131        cbeg: *const c_int,
132        cind: *const c_int,
133        cval: *const c_double,
134        sense: *const c_char,
135        rhs: *const c_double,
136        constrname: *const c_str,
137    ) -> c_int;
138
139    pub fn GRBaddgenconstrMax(
140        model: *mut GRBmodel,
141        name: c_str,
142        resvar: c_int,
143        nvars: c_int,
144        vars: *const c_int,
145        constant: c_double,
146    ) -> c_int;
147
148    pub fn GRBaddgenconstrMin(
149        model: *mut GRBmodel,
150        name: c_str,
151        resvar: c_int,
152        nvars: c_int,
153        vars: *const c_int,
154        constant: c_double,
155    ) -> c_int;
156
157    pub fn GRBaddgenconstrAbs(
158        model: *mut GRBmodel,
159        name: c_str,
160        resvar: c_int,
161        argvar: c_int,
162    ) -> c_int;
163
164    pub fn GRBaddgenconstrAnd(
165        model: *mut GRBmodel,
166        name: c_str,
167        resvar: c_int,
168        nvars: c_int,
169        vars: *const c_int,
170    ) -> c_int;
171
172    pub fn GRBaddgenconstrOr(
173        model: *mut GRBmodel,
174        name: c_str,
175        resvar: c_int,
176        nvars: c_int,
177        vars: *const c_int,
178    ) -> c_int;
179
180    pub fn GRBaddgenconstrNorm(
181        model: *mut GRBmodel,
182        name: c_str,
183        resvar: c_int,
184        nvars: c_int,
185        vars: *const c_int,
186        which: c_double,
187    ) -> c_int;
188
189    pub fn GRBaddgenconstrIndicator(
190        model: *mut GRBmodel,
191        name: c_str,
192        binvar: c_int,
193        binval: c_int,
194        nvars: c_int,
195        ind: *const c_int,
196        val: *const c_double,
197        sense: c_char,
198        rhs: c_double,
199    ) -> c_int;
200
201    pub fn GRBaddgenconstrPWL(
202        model: *mut GRBmodel,
203        name: c_str,
204        xvar: c_int,
205        yvar: c_int,
206        npts: c_int,
207        xpts: *const c_double,
208        ypts: *const c_double,
209    ) -> c_int;
210
211    pub fn GRBaddgenconstrPoly(
212        model: *mut GRBmodel,
213        name: c_str,
214        xvar: c_int,
215        yvar: c_int,
216        plen: c_int,
217        p: *mut c_double,
218        options: c_str,
219    ) -> c_int;
220
221    add_func_constr!(
222        GRBaddgenconstrExp,
223        GRBaddgenconstrLog,
224        GRBaddgenconstrLogistic,
225        GRBaddgenconstrSin,
226        GRBaddgenconstrCos,
227        GRBaddgenconstrTan
228    );
229
230    add_funca_constr!(GRBaddgenconstrExpA, GRBaddgenconstrLogA, GRBaddgenconstrPow);
231
232    pub fn GRBaddqconstr(
233        model: *mut GRBmodel,
234        numlnz: c_int,
235        lind: *const c_int,
236        lval: *const c_double,
237        numqnz: c_int,
238        qrow: *const c_int,
239        qcol: *const c_int,
240        qval: *const c_double,
241        sense: c_char,
242        rhs: c_double,
243        QCname: c_str,
244    ) -> c_int;
245
246    pub fn GRBaddqpterms(
247        model: *mut GRBmodel,
248        numqnz: c_int,
249        qrow: *const c_int,
250        qcol: *const c_int,
251        qval: *const c_double,
252    ) -> c_int;
253
254    pub fn GRBaddrangeconstr(
255        model: *mut GRBmodel,
256        numnz: c_int,
257        cind: *const c_int,
258        cval: *const c_double,
259        lower: c_double,
260        upper: c_double,
261        constrname: c_str,
262    ) -> c_int;
263
264    pub fn GRBaddrangeconstrs(
265        model: *mut GRBmodel,
266        numconstrs: c_int,
267        numnz: c_int,
268        cbeg: *const c_int,
269        cind: *const c_int,
270        cval: *const c_double,
271        lower: *const c_double,
272        upper: *const c_double,
273        constrname: *const c_str,
274    ) -> c_int;
275
276    pub fn GRBaddsos(
277        model: *mut GRBmodel,
278        numsos: c_int,
279        nummembers: c_int,
280        types: *const c_int,
281        beg: *const c_int,
282        ind: *const c_int,
283        weight: *const c_double,
284    ) -> c_int;
285
286    pub fn GRBaddvar(
287        model: *mut GRBmodel,
288        numnz: c_int,
289        vind: *const c_int,
290        vval: *const c_double,
291        obj: f64,
292        lb: f64,
293        ub: f64,
294        vtype: c_char,
295        name: c_str,
296    ) -> c_int;
297
298    pub fn GRBaddvars(
299        model: *mut GRBmodel,
300        numvars: c_int,
301        numnz: c_int,
302        vbeg: *const c_int,
303        vind: *const c_int,
304        vval: *const c_double,
305        obj: *const f64,
306        lb: *const f64,
307        ub: *const f64,
308        vtype: *const c_char,
309        name: *const c_str,
310    ) -> c_int;
311
312    pub fn GRBchgcoeffs(
313        model: *mut GRBmodel,
314        cnt: c_int,
315        cind: *const c_int,
316        vind: *const c_int,
317        val: *const c_double,
318    ) -> c_int;
319
320    pub fn GRBdelvars(model: *mut GRBmodel, numdel: c_int, ind: *const c_int) -> c_int;
321
322    pub fn GRBdelconstrs(model: *mut GRBmodel, numdel: c_int, ind: *const c_int) -> c_int;
323
324    pub fn GRBdelgenconstrs(model: *mut GRBmodel, numdel: c_int, ind: *const c_int) -> c_int;
325
326    pub fn GRBdelq(model: *mut GRBmodel) -> c_int;
327
328    pub fn GRBdelqconstrs(model: *mut GRBmodel, len: c_int, ind: *const c_int) -> c_int;
329
330    pub fn GRBdelsos(model: *mut GRBmodel, len: c_int, ind: *const c_int) -> c_int;
331
332    pub fn GRBsetpwlobj(
333        model: *mut GRBmodel,
334        var: c_int,
335        points: c_int,
336        x: *const c_double,
337        y: *const c_double,
338    ) -> c_int;
339
340    pub fn GRBupdatemodel(model: *mut GRBmodel) -> c_int;
341
342    pub fn GRBfreemodel(model: *mut GRBmodel) -> c_int;
343}
344
345// Model Solution
346extern "C" {
347
348    pub fn GRBoptimize(model: *mut GRBmodel) -> c_int;
349
350    pub fn GRBoptimizeasync(model: *mut GRBmodel) -> c_int;
351
352    pub fn GRBcomputeIIS(model: *mut GRBmodel) -> c_int;
353
354    pub fn GRBfeasrelax(
355        model: *mut GRBmodel,
356        relaxobjtype: c_int,
357        minrelax: c_int,
358        lbpen: *const c_double,
359        ubpen: *const c_double,
360        rhspen: *const c_double,
361        feasobjP: *const c_double,
362    ) -> c_int;
363
364    pub fn GRBfixmodel(model: *mut GRBmodel, new_model: *mut *mut GRBmodel) -> c_int;
365
366    pub fn GRBreset(model: *mut GRBmodel, clearall: c_int) -> c_int;
367
368    pub fn GRBsync(model: *mut GRBmodel) -> c_int;
369}
370
371// Model Queries
372extern "C" {
373    pub fn GRBgetcoeff(
374        model: *mut GRBmodel,
375        constr: c_int,
376        var: c_int,
377        valP: *mut c_double,
378    ) -> c_int;
379
380    pub fn GRBgetconstrbyname(model: *mut GRBmodel, name: c_str, constrnumP: *mut c_int) -> c_int;
381
382    pub fn GRBgetconstrs(
383        model: *mut GRBmodel,
384        numnzP: *mut c_int,
385        cbeg: *mut c_int,
386        cind: *mut c_int,
387        cval: *mut c_double,
388        start: c_int,
389        len: c_int,
390    ) -> c_int;
391
392    pub fn GRBgetenv(model: *mut GRBmodel) -> *mut GRBenv;
393
394    pub fn GRBgetgenconstrMax(
395        model: *mut GRBmodel,
396        id: c_int,
397        resvarP: *mut c_int,
398        nvarsP: *mut c_int,
399        vars: *mut c_int,
400        constantP: *mut c_double,
401    ) -> c_int;
402
403    pub fn GRBgetgenconstrMin(
404        model: *mut GRBmodel,
405        id: c_int,
406        resvarP: *mut c_int,
407        nvarsP: *mut c_int,
408        vars: *mut c_int,
409        constantP: *mut c_double,
410    ) -> c_int;
411
412    pub fn GRBgetgenconstrAbs(
413        model: *mut GRBmodel,
414        id: c_int,
415        resvarP: *mut c_int,
416        argvarP: *mut c_int,
417    ) -> c_int;
418
419    pub fn GRBgetgenconstrAnd(
420        model: *mut GRBmodel,
421        id: c_int,
422        resvarP: *mut c_int,
423        nvarsP: *mut c_int,
424        vars: *mut c_int,
425    ) -> c_int;
426
427    pub fn GRBgetgenconstrOr(
428        model: *mut GRBmodel,
429        id: c_int,
430        resvarP: *mut c_int,
431        nvarsP: *mut c_int,
432        vars: *mut c_int,
433    ) -> c_int;
434
435    pub fn GRBgetgenconstrNorm(
436        model: *mut GRBmodel,
437        id: c_int,
438        resvarP: *mut c_int,
439        nvarsP: *mut c_int,
440        vars: *mut c_int,
441        whichP: *mut c_double,
442    ) -> c_int;
443
444    pub fn GRBgetgenconstrIndicator(
445        model: *mut GRBmodel,
446        id: c_int,
447        binvarP: *mut c_int,
448        binvalP: *mut c_int,
449        nvarsP: *mut c_int,
450        ind: *mut c_int,
451        val: *mut c_double,
452        senseP: *mut c_char,
453        rhsP: *mut c_double,
454    ) -> c_int;
455
456    pub fn GRBgetgenconstrPWL(
457        model: *mut GRBmodel,
458        id: c_int,
459        xvarP: *mut c_int,
460        yvarP: *mut c_int,
461        nptsP: *mut c_int,
462        xpts: *mut c_double,
463        y_pts: *mut c_double,
464    ) -> c_int;
465
466    pub fn GRBgetgenconstrPoly(
467        model: *mut GRBmodel,
468        id: c_int,
469        xvarP: *mut c_int,
470        yvarP: *mut c_int,
471        plenP: *mut c_int,
472        p: *mut c_double,
473    ) -> c_int;
474
475    get_func_constr!(
476        GRBgetgenconstrExp,
477        GRBgetgenconstrLog,
478        GRBgetgenconstrLogistic
479    );
480
481    get_funca_constr!(
482        GRBgetgenconstrExpA,
483        GRBgetgenconstrLogA,
484        GRBgetgenconstrPow,
485        GRBgetgenconstrSin,
486        GRBgetgenconstrCos,
487        GRBgetgenconstrTan
488    );
489
490    pub fn GRBgetpwlobj(
491        model: *mut GRBmodel,
492        var: c_int,
493        npointsP: *mut c_int,
494        x: *mut c_double,
495        y: *mut c_double,
496    ) -> c_int;
497
498    pub fn GRBgetq(
499        model: *mut GRBmodel,
500        numqnzP: *mut c_int,
501        qrow: *mut c_int,
502        qcol: *mut c_int,
503        qval: *mut c_double,
504    ) -> c_int;
505
506    pub fn GRBgetqconstr(
507        model: *mut GRBmodel,
508        qconstr: c_int,
509        numlnzP: *mut c_int,
510        lind: *mut c_int,
511        lval: *mut c_double,
512        numqnzP: *mut c_int,
513        qrow: *mut c_int,
514        qcol: *mut c_int,
515        qval: *mut c_double,
516    ) -> c_int;
517
518    pub fn GRBgetsos(
519        model: *mut GRBmodel,
520        nummembersP: *mut c_int,
521        sostype: *mut c_int,
522        beg: *mut c_int,
523        ind: *mut c_int,
524        weight: *mut c_double,
525        start: c_int,
526        len: c_int,
527    ) -> c_int;
528
529    pub fn GRBgetvarbyname(model: *mut GRBmodel, name: c_str, varnumP: *mut c_int) -> c_int;
530
531    pub fn GRBgetvars(
532        model: *mut GRBmodel,
533        numnzP: *mut c_int,
534        vbeg: *mut c_int,
535        vind: *mut c_int,
536        vval: *mut c_double,
537        start: c_int,
538        len: c_int,
539    ) -> c_int;
540
541    pub fn GRBsinglescenariomodel(
542        model: *mut GRBmodel,
543        singlescenarioP: *mut *mut GRBmodel,
544    ) -> c_int;
545
546    // Xgetconstrs
547    // Xgetvars
548}
549
550// Input/Output
551extern "C" {
552    pub fn GRBreadmodel(env: *mut GRBenv, filename: c_str, modelP: *mut *mut GRBmodel) -> c_int;
553
554    pub fn GRBread(model: *mut GRBmodel, filename: c_str) -> c_int;
555
556    pub fn GRBwrite(model: *mut GRBmodel, filename: c_str) -> c_int;
557
558}
559
560extern "C" {
561    pub fn GRBgetattrinfo(
562        model: *mut GRBmodel,
563        attrname: c_str,
564        datatypeP: *mut c_int,
565        attrtypeP: *mut c_int,
566        settableP: *mut c_int,
567    ) -> c_int;
568}
569
570extern "C" {
571    pub fn GRBgetintattr(model: *mut GRBmodel, attrname: c_str, valueP: *mut c_int) -> c_int;
572
573    pub fn GRBgetdblattr(model: *mut GRBmodel, attrname: c_str, valueP: *mut c_double) -> c_int;
574
575    pub fn GRBgetstrattr(model: *mut GRBmodel, attrname: c_str, valueP: *mut c_str) -> c_int;
576
577    pub fn GRBsetintattr(model: *mut GRBmodel, attrname: c_str, value: c_int) -> c_int;
578
579    pub fn GRBsetdblattr(model: *mut GRBmodel, attrname: c_str, value: c_double) -> c_int;
580
581    pub fn GRBsetstrattr(model: *mut GRBmodel, attrname: c_str, value: c_str) -> c_int;
582}
583
584extern "C" {
585    pub fn GRBgetintattrelement(
586        model: *mut GRBmodel,
587        attrname: c_str,
588        element: c_int,
589        valueP: *mut c_int,
590    ) -> c_int;
591
592    pub fn GRBgetdblattrelement(
593        model: *mut GRBmodel,
594        attrname: c_str,
595        element: c_int,
596        valueP: *mut c_double,
597    ) -> c_int;
598
599    pub fn GRBgetcharattrelement(
600        model: *mut GRBmodel,
601        attrname: c_str,
602        element: c_int,
603        valueP: *mut c_char,
604    ) -> c_int;
605
606    pub fn GRBgetstrattrelement(
607        model: *mut GRBmodel,
608        attrname: c_str,
609        element: c_int,
610        valueP: *mut c_str,
611    ) -> c_int;
612
613    pub fn GRBsetintattrelement(
614        model: *mut GRBmodel,
615        attrname: c_str,
616        element: c_int,
617        value: c_int,
618    ) -> c_int;
619
620    pub fn GRBsetdblattrelement(
621        model: *mut GRBmodel,
622        attrname: c_str,
623        element: c_int,
624        value: c_double,
625    ) -> c_int;
626
627    pub fn GRBsetcharattrelement(
628        model: *mut GRBmodel,
629        attrname: c_str,
630        element: c_int,
631        value: c_char,
632    ) -> c_int;
633
634    pub fn GRBsetstrattrelement(
635        model: *mut GRBmodel,
636        attrname: c_str,
637        element: c_int,
638        value: c_str,
639    ) -> c_int;
640}
641
642extern "C" {
643    pub fn GRBgetintattrarray(
644        model: *mut GRBmodel,
645        attrname: c_str,
646        first: c_int,
647        len: c_int,
648        values: *mut c_int,
649    ) -> c_int;
650
651    pub fn GRBgetdblattrarray(
652        model: *mut GRBmodel,
653        attrname: c_str,
654        first: c_int,
655        len: c_int,
656        values: *mut c_double,
657    ) -> c_int;
658
659    pub fn GRBgetcharattrarray(
660        model: *mut GRBmodel,
661        attrname: c_str,
662        first: c_int,
663        len: c_int,
664        values: *mut c_char,
665    ) -> c_int;
666
667    pub fn GRBgetstrattrarray(
668        model: *mut GRBmodel,
669        attrname: c_str,
670        first: c_int,
671        len: c_int,
672        values: *mut c_str,
673    ) -> c_int;
674
675    pub fn GRBsetintattrarray(
676        model: *mut GRBmodel,
677        attrname: c_str,
678        first: c_int,
679        len: c_int,
680        values: *const c_int,
681    ) -> c_int;
682
683    pub fn GRBsetdblattrarray(
684        model: *mut GRBmodel,
685        attrname: c_str,
686        first: c_int,
687        len: c_int,
688        values: *const c_double,
689    ) -> c_int;
690
691    pub fn GRBsetcharattrarray(
692        model: *mut GRBmodel,
693        attrname: c_str,
694        first: c_int,
695        len: c_int,
696        values: *const c_char,
697    ) -> c_int;
698
699    pub fn GRBsetstrattrarray(
700        model: *mut GRBmodel,
701        attrname: *const c_char,
702        first: c_int,
703        len: c_int,
704        values: *const c_str,
705    ) -> c_int;
706}
707
708extern "C" {
709    pub fn GRBgetintattrlist(
710        model: *mut GRBmodel,
711        attrname: c_str,
712        len: c_int,
713        ind: *const c_int,
714        values: *mut c_int,
715    ) -> c_int;
716
717    pub fn GRBgetdblattrlist(
718        model: *mut GRBmodel,
719        attrname: c_str,
720        len: c_int,
721        ind: *const c_int,
722        values: *mut c_double,
723    ) -> c_int;
724
725    pub fn GRBgetcharattrlist(
726        model: *mut GRBmodel,
727        attrname: c_str,
728        len: c_int,
729        ind: *const c_int,
730        values: *mut c_char,
731    ) -> c_int;
732
733    pub fn GRBgetstrattrlist(
734        model: *mut GRBmodel,
735        attrname: c_str,
736        len: c_int,
737        ind: *const c_int,
738        values: *mut c_str,
739    ) -> c_int;
740
741    pub fn GRBsetintattrlist(
742        model: *mut GRBmodel,
743        attrname: c_str,
744        len: c_int,
745        ind: *const c_int,
746        values: *const c_int,
747    ) -> c_int;
748
749    pub fn GRBsetdblattrlist(
750        model: *mut GRBmodel,
751        attrname: c_str,
752        len: c_int,
753        ind: *const c_int,
754        values: *const c_double,
755    ) -> c_int;
756
757    pub fn GRBsetcharattrlist(
758        model: *mut GRBmodel,
759        attrname: c_str,
760        len: c_int,
761        ind: *const c_int,
762        values: *const c_char,
763    ) -> c_int;
764
765    pub fn GRBsetstrattrlist(
766        model: *mut GRBmodel,
767        attrname: *const c_char,
768        len: c_int,
769        ind: *const c_int,
770        values: *const c_str,
771    ) -> c_int;
772}
773
774// Parameter Management and Tuning
775extern "C" {
776    pub fn GRBtunemodel(model: *mut GRBmodel) -> c_int;
777
778    pub fn GRBgettuneresult(model: *mut GRBmodel, n: c_int) -> c_int;
779
780    pub fn GRBgetdblparam(env: *mut GRBenv, paramname: c_str, value: *mut c_double) -> c_int;
781
782    pub fn GRBgetintparam(env: *mut GRBenv, paramname: c_str, value: *mut c_int) -> c_int;
783
784    pub fn GRBgetstrparam(env: *mut GRBenv, paramname: c_str, value: *mut c_char) -> c_int;
785
786    pub fn GRBsetdblparam(env: *mut GRBenv, paramname: c_str, value: c_double) -> c_int;
787
788    pub fn GRBsetintparam(env: *mut GRBenv, paramname: c_str, value: c_int) -> c_int;
789
790    pub fn GRBsetstrparam(env: *mut GRBenv, paramname: c_str, value: c_str) -> c_int;
791
792    pub fn GRBgetdblparaminfo(
793        env: *mut GRBenv,
794        paramname: c_str,
795        valueP: *mut c_double,
796        minP: *mut c_double,
797        maxP: *mut c_double,
798        defaultP: *mut c_double,
799    ) -> c_int;
800
801    pub fn GRBgetintparaminfo(
802        env: *mut GRBenv,
803        paramname: c_str,
804        valueP: *mut c_int,
805        minP: *mut c_int,
806        maxP: *mut c_int,
807        defaultP: *mut c_int,
808    ) -> c_int;
809
810    pub fn GRBgetstrparaminfo(
811        env: *mut GRBenv,
812        paramname: c_str,
813        valueP: *mut c_char,
814        defaultP: *mut c_char,
815    ) -> c_int;
816
817    pub fn GRBreadparams(env: *mut GRBenv, filename: c_str) -> c_int;
818
819    pub fn GRBwriteparams(env: *mut GRBenv, filename: c_str) -> c_int;
820}
821
822// Monitoring Progress - Logging and Callbacks
823extern "C" {
824    pub fn GRBmsg(env: *mut GRBenv, message: c_str);
825
826    pub fn GRBsetcallbackfunc(
827        model: *mut GRBmodel,
828        cb: Option<extern "C" fn(*mut GRBmodel, *mut c_void, c_int, *mut c_void) -> c_int>,
829        usrdata: *mut c_void,
830    ) -> c_int;
831
832    pub fn GRBgetcallbackfunc(
833        model: *mut GRBmodel,
834        cb: *mut Option<extern "C" fn(*mut GRBmodel, *mut c_void, c_int, *mut c_void) -> c_int>,
835    ) -> c_int;
836
837    pub fn GRBcbget(cbdata: *mut c_void, where_: c_int, what: c_int, resultP: *mut c_void)
838        -> c_int;
839
840    pub fn GRBversion(majorP: *mut c_int, minorP: *mut c_int, technicalP: *mut c_int);
841}
842
843// Modifying Solver Behaviour - Callbacks
844extern "C" {
845    pub fn GRBcbcut(
846        cbdata: *mut c_void,
847        cutlen: c_int,
848        cutind: *const c_int,
849        cutval: *const c_double,
850        cutsense: c_char,
851        cutrhs: c_double,
852    ) -> c_int;
853
854    pub fn GRBcblazy(
855        cbdata: *mut c_void,
856        lazylen: c_int,
857        lazyind: *const c_int,
858        lazyval: *const c_double,
859        lazysense: c_char,
860        lazyrhs: c_double,
861    ) -> c_int;
862
863    pub fn GRBcbsolution(
864        cbdata: *mut c_void,
865        solution: *const c_double,
866        obj_ptr: *mut c_double,
867    ) -> c_int;
868
869    pub fn GRBterminate(model: *mut GRBmodel);
870
871    pub fn GRBcbproceed(model: *mut GRBmodel);
872}
873
874// Error Handling
875extern "C" {
876    pub fn GRBgeterrormsg(env: *mut GRBenv) -> c_str;
877}
878
879// Advanced simplex routines
880extern "C" {
881    pub fn GRBFSolve(model: *mut GRBmodel, b: *mut GRBsvec, x: *mut GRBsvec) -> c_int;
882
883    pub fn GRBBSolve(model: *mut GRBmodel, b: *mut GRBsvec, x: *mut GRBsvec) -> c_int;
884
885    pub fn GRBBinvColj(model: *mut GRBmodel, j: c_int, x: *mut GRBsvec) -> c_int;
886
887    pub fn GRBBinvRowi(model: *mut GRBmodel, i: c_int, x: *mut GRBsvec) -> c_int;
888
889    pub fn GRBgetBasisHead(model: *mut GRBmodel, bhead: *mut c_int) -> c_int;
890}
891
892// cheeky hack to get unit tests for build scripts.
893#[cfg(feature = "build_script_tests")]
894#[path = "../build.rs"]
895#[allow(unused)]
896mod build;