-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathlp_lib.h
2294 lines (1998 loc) · 117 KB
/
lp_lib.h
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
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
#ifndef HEADER_lp_lib
#define HEADER_lp_lib
/* --------------------------------------------------------------------------
This is the main library header file for the lp_solve v5.0 release
Starting at version 3.0, LP_Solve is released under the LGPL license.
For full information, see the enclosed file LGPL.txt.
Original developer: Michel Berkelaar - [email protected]
Most changes 1.5-2.0: Jeroen Dirks - [email protected]
Changes 3.2-4.0: Kjell Eikland - [email protected]
(Simplex code, SOS, SC, code optimization)
Peter Notebaert - [email protected]
(Sensitivity analysis, documentation)
Changes 5.0+: Kjell Eikland - [email protected]
(BFP, XLI, simplex, B&B, code modularization)
Peter Notebaert - [email protected]
(Sensitivity analysis, New lp parser, LINDO (XLI)
parser, VB/.NET interface, documentation)
Release notes:
Version 4.0 enhances version 3.2 in terms of internal program/simplex
architecture, call level interfaces, data layout, features and contains
several bug fixes. There is now complete support for semi-continuous
variables and SOS constructions. In the process, a complete API
was added. The MPS parser has been amended to support this.
Sensitivity analysis and variouse bug fixes was provided by Peter
Notebaert in 4.0 sub-releases. Peter also wrote a complete
documentation of the API and contributed a VB interface, both of which
significantly enhanced the accessibility of lp_solve.
Version 5.0 is a major rewrite and code cleanup. The main additions that
drove forward this cleanup were the modular inversion logic with optimal
column ordering, addition of primal phase 1 and dual phase 2 logic for
full flexibility in the selection of primal and dual simplex modes,
DEVEX and steepest edge pivot selection, along with dynamic cycling
detection and prevention. This cleanup made it possible to harmonize the
internal rounding principles, contributing to increased numerical stability.
Version 5.1 rearranges the matrix storage model by enabling both legacy
element record-based storage and split vector storage. In addition the
lprec structure is optimized and additional routines are added, mainly for
sparse vector additions and enhanced XLI functionality. Support for XML-
based models was added on the basis of the LPFML schema via xli_LPFML.
Version 5.2 removes the objective function from the constraint matrix,
adds a number of presolve options and speed them up. Degeneracy handling
is significantly improved. Support for XLI_ZIMPL was added.
Multiple and partial pricing has been enhanced and activated.
-------------------------------------------------------------------------- */
/* Define user program feature option switches */
/* ------------------------------------------------------------------------- */
# if defined _WIN32 && !defined __GNUC__
# define isnan _isnan
# endif
#if defined NOISNAN
# define isnan(x) FALSE
#endif
#define SETMASK(variable, mask) variable |= mask
#define CLEARMASK(variable, mask) variable &= ~(mask)
#define TOGGLEMASK(variable, mask) variable ^= mask
#define ISMASKSET(variable, mask) (MYBOOL) (((variable) & (mask)) != 0)
/* Utility/system settings */
/* ------------------------------------------------------------------------- */
/*#define INTEGERTIME */ /* Set use of lower-resolution timer */
/* New v5.0+ simplex/optimization features and settings */
/* ------------------------------------------------------------------------- */
/*#define NoRowScaleOF */ /* Optionally skip row-scaling of the OF */
#define DoMatrixRounding /* Round A matrix elements to precision */
#define DoBorderRounding /* Round RHS, bounds and ranges to precision */
#define Phase1EliminateRedundant /* Remove rows of redundant artificials */
#define FixViolatedOptimal
#define ImproveSolutionPrecision /* Round optimal solution values */
/*#define IncreasePivotOnReducedAccuracy */ /* Increase epspivot on instability */
/*#define FixInaccurateDualMinit */ /* Reinvert on inaccuracy in dual minits */
/*#define EnforcePositiveTheta */ /* Ensure that the theta range is valid */
#define ResetMinitOnReinvert
/*#define UsePrimalReducedCostUpdate */ /* Not tested */
/*#define UseDualReducedCostUpdate */ /* Seems Ok, but slower than expected */
/*#ifdef UseLegacyExtrad */ /* Use v3.2- style Extrad method */
#define UseMilpExpandedRCF /* Non-ints in reduced cost bound tightening */
/*#define UseMilpSlacksRCF */ /* Slacks in reduced cost bound tightening (degen
prone); requires !SlackInitMinusInf */
#define LegacySlackDefinition /* Slack as the "value of the constraint" */
/* Development features (change at own risk) */
/* ------------------------------------------------------------------------- */
/*#define MIPboundWithOF */ /* Enable to detect OF constraint for use during B&B */
/*#define SlackInitMinusInf */ /* Slacks have 0 LB if this is not defined */
#define FULLYBOUNDEDSIMPLEX FALSE /* WARNING: Activate at your own risk! */
/* Specify use of the basic linear algebra subroutine library */
/* ------------------------------------------------------------------------- */
#define libBLAS 2 /* 0: No, 1: Internal, 2: External */
#define libnameBLAS "myBLAS"
/* Active inverse logic (default is optimized original etaPFI) */
/* ------------------------------------------------------------------------- */
#if !defined LoadInverseLib
# define LoadInverseLib TRUE /* Enable alternate inverse libraries */
#endif
/*#define ExcludeNativeInverse */ /* Disable INVERSE_ACTIVE inverse engine */
#define DEF_OBJINBASIS TRUE /* Additional rows inserted at the top (1 => OF) */
#define INVERSE_NONE -1
#define INVERSE_LEGACY 0
#define INVERSE_ETAPFI 1
#define INVERSE_LUMOD 2
#define INVERSE_LUSOL 3
#define INVERSE_GLPKLU 4
#ifndef RoleIsExternalInvEngine /* Defined in inverse DLL drivers */
#ifdef ExcludeNativeInverse
#define INVERSE_ACTIVE INVERSE_NONE /* Disable native engine */
#else
#define INVERSE_ACTIVE INVERSE_LEGACY /* User or DLL-selected */
#endif
#endif
/* Active external language interface logic (default is none) */
/* ------------------------------------------------------------------------- */
#if !defined LoadLanguageLib
# define LoadLanguageLib TRUE /* Enable alternate language libraries */
#endif
#define ExcludeNativeLanguage /* Disable LANGUAGE_ACTIVE XLI */
#define LANGUAGE_NONE -1
#define LANGUAGE_LEGACYLP 0
#define LANGUAGE_CPLEXLP 1
#define LANGUAGE_MPSX 2
#define LANGUAGE_LPFML 3
#define LANGUAGE_MATHPROG 4
#define LANGUAGE_AMPL 5
#define LANGUAGE_GAMS 6
#define LANGUAGE_ZIMPL 7
#define LANGUAGE_S 8
#define LANGUAGE_R 9
#define LANGUAGE_MATLAB 10
#define LANGUAGE_OMATRIX 11
#define LANGUAGE_SCILAB 12
#define LANGUAGE_OCTAVE 13
#define LANGUAGE_EMPS 14
#ifndef RoleIsExternalLanguageEngine /* Defined in XLI driver libraries */
#ifdef ExcludeNativeLanguage
#define LANGUAGE_ACTIVE LANGUAGE_NONE /* Disable native engine */
#else
#define LANGUAGE_ACTIVE LANGUAGE_CPLEXLP /* User or DLL-selected */
#endif
#endif
/* Default parameters and tolerances */
/* ------------------------------------------------------------------------- */
#define OriginalPARAM 0
#define ProductionPARAM 1
#define ChvatalPARAM 2
#define LoosePARAM 3
#if 1
#define ActivePARAM ProductionPARAM
#else
#define ActivePARAM LoosePARAM
#endif
/* Miscellaneous settings */
/* ------------------------------------------------------------------------- */
#ifndef Paranoia
#ifdef _DEBUG
#define Paranoia
#endif
#endif
/* Program version data */
/* ------------------------------------------------------------------------- */
#define MAJORVERSION 5
#define MINORVERSION 5
#define RELEASE 2
#define BUILD 0
#define BFPVERSION 12 /* Checked against bfp_compatible() */
#define XLIVERSION 12 /* Checked against xli_compatible() */
/* Note that both BFPVERSION and XLIVERSION typically have to be incremented
in the case that the lprec structure changes. */
/* Include/header files */
/* ------------------------------------------------------------------------- */
#include <sys/types.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <stdio.h>
#include "lp_types.h"
#include "lp_utils.h"
#if (LoadInverseLib == TRUE) || (LoadLanguageLib == TRUE)
#ifdef WIN32
#include <windows.h>
#else
#include <dlfcn.h>
#endif
#endif
#ifndef BFP_CALLMODEL
#ifdef WIN32
#define BFP_CALLMODEL __stdcall /* "Standard" call model */
#else
#define BFP_CALLMODEL
#endif
#endif
#ifndef XLI_CALLMODEL
#define XLI_CALLMODEL BFP_CALLMODEL
#endif
#define REGISTER register /* Speed up certain operations */
/* Definition of program constrants */
/* ------------------------------------------------------------------------- */
#define SIMPLEX_UNDEFINED 0
#define SIMPLEX_Phase1_PRIMAL 1
#define SIMPLEX_Phase1_DUAL 2
#define SIMPLEX_Phase2_PRIMAL 4
#define SIMPLEX_Phase2_DUAL 8
#define SIMPLEX_DYNAMIC 16
#define SIMPLEX_AUTODUALIZE 32
#define SIMPLEX_PRIMAL_PRIMAL (SIMPLEX_Phase1_PRIMAL + SIMPLEX_Phase2_PRIMAL)
#define SIMPLEX_DUAL_PRIMAL (SIMPLEX_Phase1_DUAL + SIMPLEX_Phase2_PRIMAL)
#define SIMPLEX_PRIMAL_DUAL (SIMPLEX_Phase1_PRIMAL + SIMPLEX_Phase2_DUAL)
#define SIMPLEX_DUAL_DUAL (SIMPLEX_Phase1_DUAL + SIMPLEX_Phase2_DUAL)
#define SIMPLEX_DEFAULT (SIMPLEX_DUAL_PRIMAL)
/* Variable codes (internal) */
#define ISREAL 0
#define ISINTEGER 1
#define ISSEMI 2
#define ISSOS 4
#define ISSOSTEMPINT 8
#define ISGUB 16
/* Presolve defines */
#define PRESOLVE_NONE 0
#define PRESOLVE_ROWS 1
#define PRESOLVE_COLS 2
#define PRESOLVE_LINDEP 4
#define PRESOLVE_AGGREGATE 8 /* Not implemented */
#define PRESOLVE_SPARSER 16 /* Not implemented */
#define PRESOLVE_SOS 32
#define PRESOLVE_REDUCEMIP 64
#define PRESOLVE_KNAPSACK 128 /* Implementation not tested completely */
#define PRESOLVE_ELIMEQ2 256
#define PRESOLVE_IMPLIEDFREE 512
#define PRESOLVE_REDUCEGCD 1024
#define PRESOLVE_PROBEFIX 2048
#define PRESOLVE_PROBEREDUCE 4096
#define PRESOLVE_ROWDOMINATE 8192
#define PRESOLVE_COLDOMINATE 16384 /* Reduced functionality, should be expanded */
#define PRESOLVE_MERGEROWS 32768
#define PRESOLVE_IMPLIEDSLK 65536
#define PRESOLVE_COLFIXDUAL 131072
#define PRESOLVE_BOUNDS 262144
#define PRESOLVE_LASTMASKMODE (PRESOLVE_DUALS - 1)
#define PRESOLVE_DUALS 524288
#define PRESOLVE_SENSDUALS 1048576
/* Basis crash options */
#define CRASH_NONE 0
#define CRASH_NONBASICBOUNDS 1
#define CRASH_MOSTFEASIBLE 2
#define CRASH_LEASTDEGENERATE 3
/* Solution recomputation options (internal) */
#define INITSOL_SHIFTZERO 0
#define INITSOL_USEZERO 1
#define INITSOL_ORIGINAL 2
/* Strategy codes to avoid or recover from degenerate pivots,
infeasibility or numeric errors via randomized bound relaxation */
#define ANTIDEGEN_NONE 0
#define ANTIDEGEN_FIXEDVARS 1
#define ANTIDEGEN_COLUMNCHECK 2
#define ANTIDEGEN_STALLING 4
#define ANTIDEGEN_NUMFAILURE 8
#define ANTIDEGEN_LOSTFEAS 16
#define ANTIDEGEN_INFEASIBLE 32
#define ANTIDEGEN_DYNAMIC 64
#define ANTIDEGEN_DURINGBB 128
#define ANTIDEGEN_RHSPERTURB 256
#define ANTIDEGEN_BOUNDFLIP 512
#define ANTIDEGEN_DEFAULT (ANTIDEGEN_FIXEDVARS | ANTIDEGEN_STALLING /* | ANTIDEGEN_INFEASIBLE */)
/* REPORT defines */
#define NEUTRAL 0
#define CRITICAL 1
#define SEVERE 2
#define IMPORTANT 3
#define NORMAL 4
#define DETAILED 5
#define FULL 6
/* MESSAGE defines */
#define MSG_NONE 0
#define MSG_PRESOLVE 1
#define MSG_ITERATION 2
#define MSG_INVERT 4
#define MSG_LPFEASIBLE 8
#define MSG_LPOPTIMAL 16
#define MSG_LPEQUAL 32
#define MSG_LPBETTER 64
#define MSG_MILPFEASIBLE 128
#define MSG_MILPEQUAL 256
#define MSG_MILPBETTER 512
#define MSG_MILPSTRATEGY 1024
#define MSG_MILPOPTIMAL 2048
#define MSG_PERFORMANCE 4096
#define MSG_INITPSEUDOCOST 8192
/* MPS file types */
#define MPSFIXED 1
#define MPSFREE 2
#define MPSIBM 4
#define MPSNEGOBJCONST 8
#define MPS_FREE (MPSFREE<<2)
#define MPS_IBM (MPSIBM<<2)
#define MPS_NEGOBJCONST (MPSNEGOBJCONST<<2)
/* MPS defines (internal) */
#define MPSUNDEF -4
#define MPSNAME -3
#define MPSOBJSENSE -2
#define MPSOBJNAME -1
#define MPSROWS 0
#define MPSCOLUMNS 1
#define MPSRHS 2
#define MPSBOUNDS 3
#define MPSRANGES 4
#define MPSSOS 5
#define MPSVARMASK "%-8s"
#define MPSVALUEMASK "%12g"
/* Constraint type codes (internal) */
#define ROWTYPE_EMPTY 0
#define ROWTYPE_LE 1
#define ROWTYPE_GE 2
#define ROWTYPE_EQ 3
#define ROWTYPE_CONSTRAINT ROWTYPE_EQ /* This is the mask for modes */
#define ROWTYPE_OF 4
#define ROWTYPE_INACTIVE 8
#define ROWTYPE_RELAX 16
#define ROWTYPE_GUB 32
#define ROWTYPE_OFMAX (ROWTYPE_OF + ROWTYPE_GE)
#define ROWTYPE_OFMIN (ROWTYPE_OF + ROWTYPE_LE)
#define ROWTYPE_CHSIGN ROWTYPE_GE
/* Public constraint codes */
#define FR ROWTYPE_EMPTY
#define LE ROWTYPE_LE
#define GE ROWTYPE_GE
#define EQ ROWTYPE_EQ
#define OF ROWTYPE_OF
/* MIP constraint classes */
#define ROWCLASS_Unknown 0 /* Undefined/unknown */
#define ROWCLASS_Objective 1 /* The objective function */
#define ROWCLASS_GeneralREAL 2 /* General real-values constraint */
#define ROWCLASS_GeneralMIP 3 /* General mixed integer/binary and real valued constraint */
#define ROWCLASS_GeneralINT 4 /* General integer-only constraint */
#define ROWCLASS_GeneralBIN 5 /* General binary-only constraint */
#define ROWCLASS_KnapsackINT 6 /* Sum of positive integer times integer variables <= positive integer */
#define ROWCLASS_KnapsackBIN 7 /* Sum of positive integer times binary variables <= positive integer */
#define ROWCLASS_SetPacking 8 /* Sum of binary variables >= 1 */
#define ROWCLASS_SetCover 9 /* Sum of binary variables <= 1 */
#define ROWCLASS_GUB 10 /* Sum of binary variables = 1 */
#define ROWCLASS_MAX ROWCLASS_GUB
/* Column subsets (internal) */
#define SCAN_USERVARS 1
#define SCAN_SLACKVARS 2
#define SCAN_ARTIFICIALVARS 4
#define SCAN_PARTIALBLOCK 8
#define USE_BASICVARS 16
#define USE_NONBASICVARS 32
#define SCAN_NORMALVARS (SCAN_USERVARS + SCAN_ARTIFICIALVARS)
#define SCAN_ALLVARS (SCAN_SLACKVARS + SCAN_USERVARS + SCAN_ARTIFICIALVARS)
#define USE_ALLVARS (USE_BASICVARS + USE_NONBASICVARS)
#define OMIT_FIXED 64
#define OMIT_NONFIXED 128
/* Improvement defines */
#define IMPROVE_NONE 0
#define IMPROVE_SOLUTION 1
#define IMPROVE_DUALFEAS 2
#define IMPROVE_THETAGAP 4
#define IMPROVE_BBSIMPLEX 8
#define IMPROVE_DEFAULT (IMPROVE_DUALFEAS + IMPROVE_THETAGAP)
#define IMPROVE_INVERSE (IMPROVE_SOLUTION + IMPROVE_THETAGAP)
/* Scaling types */
#define SCALE_NONE 0
#define SCALE_EXTREME 1
#define SCALE_RANGE 2
#define SCALE_MEAN 3
#define SCALE_GEOMETRIC 4
#define SCALE_FUTURE1 5
#define SCALE_FUTURE2 6
#define SCALE_CURTISREID 7 /* Override to Curtis-Reid "optimal" scaling */
/* Alternative scaling weights */
#define SCALE_LINEAR 0
#define SCALE_QUADRATIC 8
#define SCALE_LOGARITHMIC 16
#define SCALE_USERWEIGHT 31
#define SCALE_MAXTYPE (SCALE_QUADRATIC-1)
/* Scaling modes */
#define SCALE_POWER2 32 /* As is or rounded to power of 2 */
#define SCALE_EQUILIBRATE 64 /* Make sure that no scaled number is above 1 */
#define SCALE_INTEGERS 128 /* Apply to integer columns/variables */
#define SCALE_DYNUPDATE 256 /* Apply incrementally every solve() */
#define SCALE_ROWSONLY 512 /* Override any scaling to only scale the rows */
#define SCALE_COLSONLY 1024 /* Override any scaling to only scale the rows */
/* Standard defines for typical scaling models (no Lagrangeans) */
#define SCALEMODEL_EQUILIBRATED (SCALE_LINEAR+SCALE_EXTREME+SCALE_INTEGERS)
#define SCALEMODEL_GEOMETRIC (SCALE_LINEAR+SCALE_GEOMETRIC+SCALE_INTEGERS)
#define SCALEMODEL_ARITHMETIC (SCALE_LINEAR+SCALE_MEAN+SCALE_INTEGERS)
#define SCALEMODEL_DYNAMIC (SCALEMODEL_GEOMETRIC+SCALE_EQUILIBRATE)
#define SCALEMODEL_CURTISREID (SCALE_CURTISREID+SCALE_INTEGERS+SCALE_POWER2)
/* Iteration status and strategies (internal) */
#define ITERATE_MAJORMAJOR 0
#define ITERATE_MINORMAJOR 1
#define ITERATE_MINORRETRY 2
/* Pricing methods */
#define PRICER_FIRSTINDEX 0
#define PRICER_DANTZIG 1
#define PRICER_DEVEX 2
#define PRICER_STEEPESTEDGE 3
#define PRICER_LASTOPTION PRICER_STEEPESTEDGE
/* Additional settings for pricers (internal) */
#define PRICER_RANDFACT 0.1
#define DEVEX_RESTARTLIMIT 1.0e+09 /* Reset the norms if any value exceeds this limit */
#define DEVEX_MINVALUE 0.000 /* Minimum weight [0..1] for entering variable, consider 0.01 */
/* Pricing strategies */
#define PRICE_PRIMALFALLBACK 4 /* In case of Steepest Edge, fall back to DEVEX in primal */
#define PRICE_MULTIPLE 8 /* Enable multiple pricing (primal simplex) */
#define PRICE_PARTIAL 16 /* Enable partial pricing */
#define PRICE_ADAPTIVE 32 /* Temporarily use alternative strategy if cycling is detected */
#define PRICE_HYBRID 64 /* NOT IMPLEMENTED */
#define PRICE_RANDOMIZE 128 /* Adds a small randomization effect to the selected pricer */
#define PRICE_AUTOPARTIAL 256 /* Detect and use data on the block structure of the model (primal) */
#define PRICE_AUTOMULTIPLE 512 /* Automatically select multiple pricing (primal simplex) */
#define PRICE_LOOPLEFT 1024 /* Scan entering/leaving columns left rather than right */
#define PRICE_LOOPALTERNATE 2048 /* Scan entering/leaving columns alternatingly left/right */
#define PRICE_HARRISTWOPASS 4096 /* Use Harris' primal pivot logic rather than the default */
#define PRICE_FORCEFULL 8192 /* Non-user option to force full pricing */
#define PRICE_TRUENORMINIT 16384 /* Use true norms for Devex and Steepest Edge initializations */
/*#define _PRICE_NOBOUNDFLIP*/
#if defined _PRICE_NOBOUNDFLIP
#define PRICE_NOBOUNDFLIP 65536 /* Disallow automatic bound-flip during pivot */
#endif
#define PRICE_STRATEGYMASK (PRICE_PRIMALFALLBACK + \
PRICE_MULTIPLE + PRICE_PARTIAL + \
PRICE_ADAPTIVE + PRICE_HYBRID + \
PRICE_RANDOMIZE + PRICE_AUTOPARTIAL + PRICE_AUTOMULTIPLE + \
PRICE_LOOPLEFT + PRICE_LOOPALTERNATE + \
PRICE_HARRISTWOPASS + \
PRICE_FORCEFULL + PRICE_TRUENORMINIT)
/* B&B active variable codes (internal) */
#define BB_REAL 0
#define BB_INT 1
#define BB_SC 2
#define BB_SOS 3
#define BB_GUB 4
/* B&B strategies */
#define NODE_FIRSTSELECT 0
#define NODE_GAPSELECT 1
#define NODE_RANGESELECT 2
#define NODE_FRACTIONSELECT 3
#define NODE_PSEUDOCOSTSELECT 4
#define NODE_PSEUDONONINTSELECT 5 /* Kjell Eikland #1 - Minimize B&B depth */
#define NODE_PSEUDOFEASSELECT (NODE_PSEUDONONINTSELECT+NODE_WEIGHTREVERSEMODE)
#define NODE_PSEUDORATIOSELECT 6 /* Kjell Eikland #2 - Minimize a "cost/benefit" ratio */
#define NODE_USERSELECT 7
#define NODE_STRATEGYMASK (NODE_WEIGHTREVERSEMODE-1) /* Mask for B&B strategies */
#define NODE_WEIGHTREVERSEMODE 8
#define NODE_BRANCHREVERSEMODE 16
#define NODE_GREEDYMODE 32
#define NODE_PSEUDOCOSTMODE 64
#define NODE_DEPTHFIRSTMODE 128
#define NODE_RANDOMIZEMODE 256
#define NODE_GUBMODE 512
#define NODE_DYNAMICMODE 1024
#define NODE_RESTARTMODE 2048
#define NODE_BREADTHFIRSTMODE 4096
#define NODE_AUTOORDER 8192
#define NODE_RCOSTFIXING 16384
#define NODE_STRONGINIT 32768
#define BRANCH_CEILING 0
#define BRANCH_FLOOR 1
#define BRANCH_AUTOMATIC 2
#define BRANCH_DEFAULT 3
/* Action constants for simplex and B&B (internal) */
#define ACTION_NONE 0
#define ACTION_ACTIVE 1
#define ACTION_REBASE 2
#define ACTION_RECOMPUTE 4
#define ACTION_REPRICE 8
#define ACTION_REINVERT 16
#define ACTION_TIMEDREINVERT 32
#define ACTION_ITERATE 64
#define ACTION_RESTART 255
/* Solver status values */
#define UNKNOWNERROR -5
#define DATAIGNORED -4
#define NOBFP -3
#define NOMEMORY -2
#define NOTRUN -1
#define OPTIMAL 0
#define SUBOPTIMAL 1
#define INFEASIBLE 2
#define UNBOUNDED 3
#define DEGENERATE 4
#define NUMFAILURE 5
#define USERABORT 6
#define TIMEOUT 7
#define RUNNING 8
#define PRESOLVED 9
/* Branch & Bound and Lagrangean extra status values (internal) */
#define PROCFAIL 10
#define PROCBREAK 11
#define FEASFOUND 12
#define NOFEASFOUND 13
#define FATHOMED 14
/* Status values internal to the solver (internal) */
#define SWITCH_TO_PRIMAL 20
#define SWITCH_TO_DUAL 21
#define SINGULAR_BASIS 22
#define LOSTFEAS 23
#define MATRIXERROR 24
/* Objective testing options for "bb_better" (internal) */
#define OF_RELAXED 0
#define OF_INCUMBENT 1
#define OF_WORKING 2
#define OF_USERBREAK 3
#define OF_HEURISTIC 4
#define OF_DUALLIMIT 5
#define OF_DELTA 8 /* Mode */
#define OF_PROJECTED 16 /* Mode - future, not active */
#define OF_TEST_BT 1
#define OF_TEST_BE 2
#define OF_TEST_NE 3
#define OF_TEST_WE 4
#define OF_TEST_WT 5
#define OF_TEST_RELGAP 8 /* Mode */
/* Name list and sparse matrix storage parameters (internal) */
#define MAT_START_SIZE 10000
#define DELTACOLALLOC 100
#define DELTAROWALLOC 100
#define RESIZEFACTOR 4 /* Fractional increase in selected memory allocations */
/* Default solver parameters and tolerances (internal) */
#define DEF_PARTIALBLOCKS 10 /* The default number of blocks for partial pricing */
#define DEF_MAXRELAX 7 /* Maximum number of non-BB relaxations in MILP */
#define DEF_MAXPIVOTRETRY 10 /* Maximum number of times to retry a div-0 situation */
#define DEF_MAXSINGULARITIES 10 /* Maximum number of singularities in refactorization */
#define MAX_MINITUPDATES 60 /* Maximum number of bound swaps between refactorizations
without recomputing the whole vector - contain errors */
#define MIN_REFACTFREQUENCY 5 /* Refactorization frequency indicating an inherent
numerical instability of the basis */
#define LAG_SINGULARLIMIT 5 /* Number of times the objective does not change
before it is assumed that the Lagrangean constraints
are non-binding, and therefore impossible to converge;
upper iteration limit is divided by this threshold */
#define MIN_TIMEPIVOT 5.0e-02 /* Minimum time per pivot for reinversion optimization
purposes; use active monitoring only if a pivot
takes more than MINTIMEPIVOT seconds. 5.0e-2 is
roughly suitable for a 1GHz system. */
#define MAX_STALLCOUNT 12 /* The absolute upper limit to the number of stalling or
cycling iterations before switching rule */
#define MAX_RULESWITCH 5 /* The maximum number of times to try an alternate pricing rule
to recover from stalling; set negative for no limit. */
#define DEF_TIMEDREFACT AUTOMATIC /* Default for timed refactorization in BFPs;
can be FALSE, TRUE or AUTOMATIC (dynamic) */
#define DEF_SCALINGLIMIT 5 /* The default maximum number of scaling iterations */
#define DEF_NEGRANGE -1.0e+06 /* Downward limit for expanded variable range before the
variable is split into positive and negative components */
#define DEF_BB_LIMITLEVEL -50 /* Relative B&B limit to protect against very deep,
memory-consuming trees */
#define MAX_FRACSCALE 6 /* The maximum decimal scan range for simulated integers */
#define RANDSCALE 100 /* Randomization scaling range */
#define DOUBLEROUND 0.0e-02 /* Extra rounding scalar used in btran/ftran calculations; the
rationale for 0.0 is that prod_xA() uses rounding as well */
#define DEF_EPSMACHINE 2.22e-16 /* Machine relative precision (doubles) */
#define MIN_STABLEPIVOT 5.0 /* Minimum pivot magnitude assumed to be numerically stable */
/* Precision macros */
/* -------------------------------------------------------------------------------------- */
#define PREC_REDUCEDCOST lp->epsvalue
#define PREC_IMPROVEGAP lp->epsdual
#define PREC_SUBSTFEASGAP lp->epsprimal
#if 1
#define PREC_BASICSOLUTION lp->epsvalue /* Zero-rounding of RHS/basic solution vector */
#else
#define PREC_BASICSOLUTION lp->epsmachine /* Zero-rounding of RHS/basic solution vector */
#endif
#define LIMIT_ABS_REL 10.0 /* Limit for testing using relative metric */
/* Parameters constants for short-cut setting of tolerances */
/* -------------------------------------------------------------------------------------- */
#define EPS_TIGHT 0
#define EPS_MEDIUM 1
#define EPS_LOOSE 2
#define EPS_BAGGY 3
#define EPS_DEFAULT EPS_TIGHT
#if ActivePARAM==ProductionPARAM /* PARAMETER SET FOR PRODUCTION */
/* -------------------------------------------------------------------------------------- */
#define DEF_INFINITE 1.0e+30 /* Limit for dynamic range */
#define DEF_EPSVALUE 1.0e-12 /* High accuracy and feasibility preserving tolerance */
#define DEF_EPSPRIMAL 1.0e-10 /* For rounding primal/RHS values to 0 */
#define DEF_EPSDUAL 1.0e-09 /* For rounding reduced costs to 0 */
#define DEF_EPSPIVOT 2.0e-07 /* Pivot reject threshold */
#define DEF_PERTURB 1.0e-05 /* Perturbation scalar for degenerate problems;
must at least be RANDSCALE greater than EPSPRIMAL */
#define DEF_EPSSOLUTION 1.0e-05 /* Margin of error for solution bounds */
#define DEF_EPSINT 1.0e-07 /* Accuracy for considering a float value as integer */
#elif ActivePARAM==OriginalPARAM /* PARAMETER SET FOR LEGACY VERSIONS */
/* -------------------------------------------------------------------------------------- */
#define DEF_INFINITE 1.0e+24 /* Limit for dynamic range */
#define DEF_EPSVALUE 1.0e-08 /* High accuracy and feasibility preserving tolerance */
#define DEF_EPSPRIMAL 5.01e-07 /* For rounding primal/RHS values to 0, infeasibility */
#define DEF_EPSDUAL 1.0e-06 /* For rounding reduced costs to 0 */
#define DEF_EPSPIVOT 1.0e-04 /* Pivot reject threshold */
#define DEF_PERTURB 1.0e-05 /* Perturbation scalar for degenerate problems;
must at least be RANDSCALE greater than EPSPRIMAL */
#define DEF_EPSSOLUTION 1.0e-02 /* Margin of error for solution bounds */
#define DEF_EPSINT 1.0e-03 /* Accuracy for considering a float value as integer */
#elif ActivePARAM==ChvatalPARAM /* PARAMETER SET EXAMPLES FROM Vacek Chvatal */
/* -------------------------------------------------------------------------------------- */
#define DEF_INFINITE 1.0e+30 /* Limit for dynamic range */
#define DEF_EPSVALUE 1.0e-10 /* High accuracy and feasibility preserving tolerance */
#define DEF_EPSPRIMAL 10e-07 /* For rounding primal/RHS values to 0 */
#define DEF_EPSDUAL 10e-05 /* For rounding reduced costs to 0 */
#define DEF_EPSPIVOT 10e-05 /* Pivot reject threshold */
#define DEF_PERTURB 10e-03 /* Perturbation scalar for degenerate problems;
must at least be RANDSCALE greater than EPSPRIMAL */
#define DEF_EPSSOLUTION 1.0e-05 /* Margin of error for solution bounds */
#define DEF_EPSINT 5.0e-03 /* Accuracy for considering a float value as integer */
#elif ActivePARAM==LoosePARAM /* PARAMETER SET FOR LOOSE TOLERANCES */
/* -------------------------------------------------------------------------------------- */
#define DEF_INFINITE 1.0e+30 /* Limit for dynamic range */
#define DEF_EPSVALUE 1.0e-10 /* High accuracy and feasibility preserving tolerance */
#define DEF_EPSPRIMAL 5.01e-08 /* For rounding primal/RHS values to 0 */
#define DEF_EPSDUAL 1.0e-07 /* For rounding reduced costs to 0 */
#define DEF_EPSPIVOT 1.0e-05 /* Pivot reject threshold */
#define DEF_PERTURB 1.0e-05 /* Perturbation scalar for degenerate problems;
must at least be RANDSCALE greater than EPSPRIMAL */
#define DEF_EPSSOLUTION 1.0e-05 /* Margin of error for solution bounds */
#define DEF_EPSINT 1.0e-04 /* Accuracy for considering a float value as integer */
#endif
#define DEF_MIP_GAP 1.0e-11 /* The default absolute and relative MIP gap */
#define SCALEDINTFIXRANGE 1.6 /* Epsilon range multiplier < 2 for collapsing bounds to fix */
#define MIN_SCALAR 1.0e-10 /* Smallest allowed scaling adjustment */
#define MAX_SCALAR 1.0e+10 /* Largest allowed scaling adjustment */
#define DEF_SCALINGEPS 1.0e-02 /* Relative scaling convergence criterion for auto_scale */
#define DEF_LAGACCEPT 1.0e-03 /* Default Lagrangean convergence acceptance criterion */
#define DEF_LAGCONTRACT 0.90 /* The contraction parameter for Lagrangean iterations */
#define DEF_LAGMAXITERATIONS 100 /* The maximum number of Lagrangean iterations */
#define DEF_PSEUDOCOSTUPDATES 7 /* The default number of times pseudo-costs are recalculated;
experiments indicate that costs tend to stabilize */
#define DEF_PSEUDOCOSTRESTART 0.15 /* The fraction of price updates required for B&B restart
when the mode is NODE_RESTARTMODE */
#define DEF_MAXPRESOLVELOOPS 0 /* Upper limit to the number of loops during presolve,
<= 0 for no limit. */
/* Hashing prototypes and function headers */
/* ------------------------------------------------------------------------- */
#include "lp_Hash.h"
/* Sparse matrix prototypes */
/* ------------------------------------------------------------------------- */
#include "lp_matrix.h"
/* Basis storage (mainly for B&B) */
typedef struct _basisrec
{
int level;
int *var_basic;
MYBOOL *is_basic;
MYBOOL *is_lower;
int pivots;
struct _basisrec *previous;
} basisrec;
/* Presolve undo data storage */
typedef struct _presolveundorec
{
lprec *lp;
int orig_rows;
int orig_columns;
int orig_sum;
int *var_to_orig; /* sum_alloc+1 : Mapping of variables from solution to
best_solution to account for removed variables and
rows during presolve; a non-positive value indicates
that the constraint or variable was removed */
int *orig_to_var; /* sum_alloc+1 : Mapping from original variable index to
current / working index number */
REAL *fixed_rhs; /* rows_alloc+1 : Storage of values of presolved fixed colums */
REAL *fixed_obj; /* columns_alloc+1: Storage of values of presolved fixed rows */
DeltaVrec *deletedA; /* A matrix of eliminated data from matA */
DeltaVrec *primalundo; /* Affine translation vectors for eliminated primal variables */
DeltaVrec *dualundo; /* Affine translation vectors for eliminated dual variables */
MYBOOL OFcolsdeleted;
} presolveundorec;
/* Pseudo-cost arrays used during B&B */
typedef struct _BBPSrec
{
lprec *lp;
int pseodotype;
int updatelimit;
int updatesfinished;
REAL restartlimit;
MATitem *UPcost;
MATitem *LOcost;
struct _BBPSrec *secondary;
} BBPSrec;
#include "lp_mipbb.h"
/* Partial pricing block data */
typedef struct _partialrec {
lprec *lp;
int blockcount; /* ## The number of logical blocks or stages in the model */
int blocknow; /* The currently active block */
int *blockend; /* Array of column indeces giving the start of each block */
int *blockpos; /* Array of column indeces giving the start scan position */
MYBOOL isrow;
} partialrec;
/* Specially Ordered Sets (SOS) prototypes and settings */
/* ------------------------------------------------------------------------- */
/* SOS storage structure (LINEARSEARCH is typically in the 0-10 range) */
#ifndef LINEARSEARCH
#define LINEARSEARCH 0
#endif
#include "lp_SOS.h"
/* Prototypes for user call-back functions */
/* ------------------------------------------------------------------------- */
typedef int (__WINAPI lphandle_intfunc)(lprec *lp, void *userhandle);
typedef void (__WINAPI lphandlestr_func)(lprec *lp, void *userhandle, char *buf);
typedef void (__WINAPI lphandleint_func)(lprec *lp, void *userhandle, int message);
typedef int (__WINAPI lphandleint_intfunc)(lprec *lp, void *userhandle, int message);
/* API typedef definitions */
/* ------------------------------------------------------------------------- */
typedef MYBOOL (__WINAPI add_column_func)(lprec *lp, REAL *column);
typedef MYBOOL (__WINAPI add_columnex_func)(lprec *lp, int count, REAL *column, int *rowno);
typedef MYBOOL (__WINAPI add_constraint_func)(lprec *lp, REAL *row, int constr_type, REAL rh);
typedef MYBOOL (__WINAPI add_constraintex_func)(lprec *lp, int count, REAL *row, int *colno, int constr_type, REAL rh);
typedef MYBOOL (__WINAPI add_lag_con_func)(lprec *lp, REAL *row, int con_type, REAL rhs);
typedef int (__WINAPI add_SOS_func)(lprec *lp, char *name, int sostype, int priority, int count, int *sosvars, REAL *weights);
typedef int (__WINAPI column_in_lp_func)(lprec *lp, REAL *column);
typedef lprec * (__WINAPI copy_lp_func)(lprec *lp);
typedef void (__WINAPI default_basis_func)(lprec *lp);
typedef MYBOOL (__WINAPI del_column_func)(lprec *lp, int colnr);
typedef MYBOOL (__WINAPI del_constraint_func)(lprec *lp, int rownr);
typedef void (__WINAPI delete_lp_func)(lprec *lp);
typedef MYBOOL (__WINAPI dualize_lp_func)(lprec *lp);
typedef void (__WINAPI free_lp_func)(lprec **plp);
typedef int (__WINAPI get_anti_degen_func)(lprec *lp);
typedef MYBOOL (__WINAPI get_basis_func)(lprec *lp, int *bascolumn, MYBOOL nonbasic);
typedef int (__WINAPI get_basiscrash_func)(lprec *lp);
typedef int (__WINAPI get_bb_depthlimit_func)(lprec *lp);
typedef int (__WINAPI get_bb_floorfirst_func)(lprec *lp);
typedef int (__WINAPI get_bb_rule_func)(lprec *lp);
typedef MYBOOL (__WINAPI get_bounds_tighter_func)(lprec *lp);
typedef REAL (__WINAPI get_break_at_value_func)(lprec *lp);
typedef char * (__WINAPI get_col_name_func)(lprec *lp, int colnr);
typedef MYBOOL (__WINAPI get_column_func)(lprec *lp, int colnr, REAL *column);
typedef int (__WINAPI get_columnex_func)(lprec *lp, int colnr, REAL *column, int *nzrow);
typedef int (__WINAPI get_constr_type_func)(lprec *lp, int rownr);
typedef REAL (__WINAPI get_constr_value_func)(lprec *lp, int rownr, int count, REAL *primsolution, int *nzindex);
typedef MYBOOL (__WINAPI get_constraints_func)(lprec *lp, REAL *constr);
typedef MYBOOL (__WINAPI get_dual_solution_func)(lprec *lp, REAL *rc);
typedef REAL (__WINAPI get_epsb_func)(lprec *lp);
typedef REAL (__WINAPI get_epsd_func)(lprec *lp);
typedef REAL (__WINAPI get_epsel_func)(lprec *lp);
typedef REAL (__WINAPI get_epsint_func)(lprec *lp);
typedef REAL (__WINAPI get_epsperturb_func)(lprec *lp);
typedef REAL (__WINAPI get_epspivot_func)(lprec *lp);
typedef int (__WINAPI get_improve_func)(lprec *lp);
typedef REAL (__WINAPI get_infinite_func)(lprec *lp);
typedef MYBOOL (__WINAPI get_lambda_func)(lprec *lp, REAL *lambda);
typedef REAL (__WINAPI get_lowbo_func)(lprec *lp, int colnr);
typedef int (__WINAPI get_lp_index_func)(lprec *lp, int orig_index);
typedef char * (__WINAPI get_lp_name_func)(lprec *lp);
typedef int (__WINAPI get_Lrows_func)(lprec *lp);
typedef REAL (__WINAPI get_mat_func)(lprec *lp, int rownr, int colnr);
typedef REAL (__WINAPI get_mat_byindex_func)(lprec *lp, int matindex, MYBOOL isrow, MYBOOL adjustsign);
typedef int (__WINAPI get_max_level_func)(lprec *lp);
typedef int (__WINAPI get_maxpivot_func)(lprec *lp);
typedef REAL (__WINAPI get_mip_gap_func)(lprec *lp, MYBOOL absolute);
typedef int (__WINAPI get_multiprice_func)(lprec *lp, MYBOOL getabssize);
typedef MYBOOL (__WINAPI is_use_names_func)(lprec *lp, MYBOOL isrow);
typedef void (__WINAPI set_use_names_func)(lprec *lp, MYBOOL isrow, MYBOOL use_names);
typedef int (__WINAPI get_nameindex_func)(lprec *lp, char *varname, MYBOOL isrow);
typedef int (__WINAPI get_Ncolumns_func)(lprec *lp);
typedef REAL (__WINAPI get_negrange_func)(lprec *lp);
typedef int (__WINAPI get_nz_func)(lprec *lp);
typedef int (__WINAPI get_Norig_columns_func)(lprec *lp);
typedef int (__WINAPI get_Norig_rows_func)(lprec *lp);
typedef int (__WINAPI get_Nrows_func)(lprec *lp);
typedef REAL (__WINAPI get_obj_bound_func)(lprec *lp);
typedef REAL (__WINAPI get_objective_func)(lprec *lp);
typedef int (__WINAPI get_orig_index_func)(lprec *lp, int lp_index);
typedef char * (__WINAPI get_origcol_name_func)(lprec *lp, int colnr);
typedef char * (__WINAPI get_origrow_name_func)(lprec *lp, int rownr);
typedef void (__WINAPI get_partialprice_func)(lprec *lp, int *blockcount, int *blockstart, MYBOOL isrow);
typedef int (__WINAPI get_pivoting_func)(lprec *lp);
typedef int (__WINAPI get_presolve_func)(lprec *lp);
typedef int (__WINAPI get_presolveloops_func)(lprec *lp);
typedef MYBOOL (__WINAPI get_primal_solution_func)(lprec *lp, REAL *pv);
typedef int (__WINAPI get_print_sol_func)(lprec *lp);
typedef MYBOOL (__WINAPI get_pseudocosts_func)(lprec *lp, REAL *clower, REAL *cupper, int *updatelimit);
typedef MYBOOL (__WINAPI get_ptr_constraints_func)(lprec *lp, REAL **constr);
typedef MYBOOL (__WINAPI get_ptr_dual_solution_func)(lprec *lp, REAL **rc);
typedef MYBOOL (__WINAPI get_ptr_lambda_func)(lprec *lp, REAL **lambda);
typedef MYBOOL (__WINAPI get_ptr_primal_solution_func)(lprec *lp, REAL **pv);
typedef MYBOOL (__WINAPI get_ptr_sensitivity_obj_func)(lprec *lp, REAL **objfrom, REAL **objtill);
typedef MYBOOL (__WINAPI get_ptr_sensitivity_objex_func)(lprec *lp, REAL **objfrom, REAL **objtill, REAL **objfromvalue, REAL **objtillvalue);
typedef MYBOOL (__WINAPI get_ptr_sensitivity_rhs_func)(lprec *lp, REAL **duals, REAL **dualsfrom, REAL **dualstill);
typedef MYBOOL (__WINAPI get_ptr_variables_func)(lprec *lp, REAL **var);
typedef REAL (__WINAPI get_rh_func)(lprec *lp, int rownr);
typedef REAL (__WINAPI get_rh_range_func)(lprec *lp, int rownr);
typedef int (__WINAPI get_rowex_func)(lprec *lp, int rownr, REAL *row, int *colno);
typedef MYBOOL (__WINAPI get_row_func)(lprec *lp, int rownr, REAL *row);
typedef char * (__WINAPI get_row_name_func)(lprec *lp, int rownr);
typedef REAL (__WINAPI get_scalelimit_func)(lprec *lp);
typedef int (__WINAPI get_scaling_func)(lprec *lp);
typedef MYBOOL (__WINAPI get_sensitivity_obj_func)(lprec *lp, REAL *objfrom, REAL *objtill);
typedef MYBOOL (__WINAPI get_sensitivity_objex_func)(lprec *lp, REAL *objfrom, REAL *objtill, REAL *objfromvalue, REAL *objtillvalue);
typedef MYBOOL (__WINAPI get_sensitivity_rhs_func)(lprec *lp, REAL *duals, REAL *dualsfrom, REAL *dualstill);
typedef int (__WINAPI get_simplextype_func)(lprec *lp);
typedef int (__WINAPI get_solutioncount_func)(lprec *lp);
typedef int (__WINAPI get_solutionlimit_func)(lprec *lp);
typedef int (__WINAPI get_status_func)(lprec *lp);
typedef char * (__WINAPI get_statustext_func)(lprec *lp, int statuscode);
typedef long (__WINAPI get_timeout_func)(lprec *lp);
typedef COUNTER (__WINAPI get_total_iter_func)(lprec *lp);
typedef COUNTER (__WINAPI get_total_nodes_func)(lprec *lp);
typedef REAL (__WINAPI get_upbo_func)(lprec *lp, int colnr);
typedef int (__WINAPI get_var_branch_func)(lprec *lp, int colnr);
typedef REAL (__WINAPI get_var_dualresult_func)(lprec *lp, int index);
typedef REAL (__WINAPI get_var_primalresult_func)(lprec *lp, int index);
typedef int (__WINAPI get_var_priority_func)(lprec *lp, int colnr);
typedef MYBOOL (__WINAPI get_variables_func)(lprec *lp, REAL *var);
typedef int (__WINAPI get_verbose_func)(lprec *lp);
typedef MYBOOL (__WINAPI guess_basis_func)(lprec *lp, REAL *guessvector, int *basisvector);
typedef REAL (__WINAPI get_working_objective_func)(lprec *lp);
typedef MYBOOL (__WINAPI has_BFP_func)(lprec *lp);
typedef MYBOOL (__WINAPI has_XLI_func)(lprec *lp);
typedef MYBOOL (__WINAPI is_add_rowmode_func)(lprec *lp);
typedef MYBOOL (__WINAPI is_anti_degen_func)(lprec *lp, int testmask);
typedef MYBOOL (__WINAPI is_binary_func)(lprec *lp, int colnr);
typedef MYBOOL (__WINAPI is_break_at_first_func)(lprec *lp);
typedef MYBOOL (__WINAPI is_constr_type_func)(lprec *lp, int rownr, int mask);
typedef MYBOOL (__WINAPI is_debug_func)(lprec *lp);
typedef MYBOOL (__WINAPI is_feasible_func)(lprec *lp, REAL *values, REAL threshold);
typedef MYBOOL (__WINAPI is_unbounded_func)(lprec *lp, int colnr);
typedef MYBOOL (__WINAPI is_infinite_func)(lprec *lp, REAL value);
typedef MYBOOL (__WINAPI is_int_func)(lprec *lp, int column);
typedef MYBOOL (__WINAPI is_integerscaling_func)(lprec *lp);
typedef MYBOOL (__WINAPI is_lag_trace_func)(lprec *lp);
typedef MYBOOL (__WINAPI is_maxim_func)(lprec *lp);
typedef MYBOOL (__WINAPI is_nativeBFP_func)(lprec *lp);
typedef MYBOOL (__WINAPI is_nativeXLI_func)(lprec *lp);
typedef MYBOOL (__WINAPI is_negative_func)(lprec *lp, int colnr);
typedef MYBOOL (__WINAPI is_obj_in_basis_func)(lprec *lp);
typedef MYBOOL (__WINAPI is_piv_mode_func)(lprec *lp, int testmask);
typedef MYBOOL (__WINAPI is_piv_rule_func)(lprec *lp, int rule);
typedef MYBOOL (__WINAPI is_presolve_func)(lprec *lp, int testmask);
typedef MYBOOL (__WINAPI is_scalemode_func)(lprec *lp, int testmask);
typedef MYBOOL (__WINAPI is_scaletype_func)(lprec *lp, int scaletype);
typedef MYBOOL (__WINAPI is_semicont_func)(lprec *lp, int colnr);
typedef MYBOOL (__WINAPI is_SOS_var_func)(lprec *lp, int colnr);
typedef MYBOOL (__WINAPI is_trace_func)(lprec *lp);
typedef void (__WINAPI lp_solve_version_func)(int *majorversion, int *minorversion, int *release, int *build);
typedef lprec * (__WINAPI make_lp_func)(int rows, int columns);
typedef void (__WINAPI print_constraints_func)(lprec *lp, int columns);
typedef MYBOOL (__WINAPI print_debugdump_func)(lprec *lp, char *filename);
typedef void (__WINAPI print_duals_func)(lprec *lp);
typedef void (__WINAPI print_lp_func)(lprec *lp);
typedef void (__WINAPI print_objective_func)(lprec *lp);
typedef void (__WINAPI print_scales_func)(lprec *lp);
typedef void (__WINAPI print_solution_func)(lprec *lp, int columns);
typedef void (__WINAPI print_str_func)(lprec *lp, char *str);
typedef void (__WINAPI print_tableau_func)(lprec *lp);
typedef void (__WINAPI put_abortfunc_func)(lprec *lp, lphandle_intfunc newctrlc, void *ctrlchandle);
typedef void (__WINAPI put_bb_nodefunc_func)(lprec *lp, lphandleint_intfunc newnode, void *bbnodehandle);
typedef void (__WINAPI put_bb_branchfunc_func)(lprec *lp, lphandleint_intfunc newbranch, void *bbbranchhandle);
typedef void (__WINAPI put_logfunc_func)(lprec *lp, lphandlestr_func newlog, void *loghandle);
typedef void (__WINAPI put_msgfunc_func)(lprec *lp, lphandleint_func newmsg, void *msghandle, int mask);
typedef lprec * (__WINAPI read_LP_func)(char *filename, int verbose, char *lp_name);
typedef lprec * (__WINAPI read_MPS_func)(char *filename, int options);
typedef lprec * (__WINAPI read_XLI_func)(char *xliname, char *modelname, char *dataname, char *options, int verbose);
typedef MYBOOL (__WINAPI read_basis_func)(lprec *lp, char *filename, char *info);
typedef void (__WINAPI reset_basis_func)(lprec *lp);
typedef MYBOOL (__WINAPI read_params_func)(lprec *lp, char *filename, char *options);
typedef void (__WINAPI reset_params_func)(lprec *lp);
typedef MYBOOL (__WINAPI resize_lp_func)(lprec *lp, int rows, int columns);
typedef MYBOOL (__WINAPI set_add_rowmode_func)(lprec *lp, MYBOOL turnon);
typedef void (__WINAPI set_anti_degen_func)(lprec *lp, int anti_degen);
typedef int (__WINAPI set_basisvar_func)(lprec *lp, int basisPos, int enteringCol);
typedef MYBOOL (__WINAPI set_basis_func)(lprec *lp, int *bascolumn, MYBOOL nonbasic);
typedef void (__WINAPI set_basiscrash_func)(lprec *lp, int mode);
typedef void (__WINAPI set_bb_depthlimit_func)(lprec *lp, int bb_maxlevel);
typedef void (__WINAPI set_bb_floorfirst_func)(lprec *lp, int bb_floorfirst);
typedef void (__WINAPI set_bb_rule_func)(lprec *lp, int bb_rule);
typedef MYBOOL (__WINAPI set_BFP_func)(lprec *lp, char *filename);
typedef MYBOOL (__WINAPI set_binary_func)(lprec *lp, int colnr, MYBOOL must_be_bin);
typedef MYBOOL (__WINAPI set_bounds_func)(lprec *lp, int colnr, REAL lower, REAL upper);
typedef void (__WINAPI set_bounds_tighter_func)(lprec *lp, MYBOOL tighten);
typedef void (__WINAPI set_break_at_first_func)(lprec *lp, MYBOOL break_at_first);
typedef void (__WINAPI set_break_at_value_func)(lprec *lp, REAL break_at_value);
typedef MYBOOL (__WINAPI set_column_func)(lprec *lp, int colnr, REAL *column);
typedef MYBOOL (__WINAPI set_columnex_func)(lprec *lp, int colnr, int count, REAL *column, int *rowno);
typedef MYBOOL (__WINAPI set_col_name_func)(lprec *lp, int colnr, char *new_name);
typedef MYBOOL (__WINAPI set_constr_type_func)(lprec *lp, int rownr, int con_type);
typedef void (__WINAPI set_debug_func)(lprec *lp, MYBOOL debug);
typedef void (__WINAPI set_epsb_func)(lprec *lp, REAL epsb);
typedef void (__WINAPI set_epsd_func)(lprec *lp, REAL epsd);
typedef void (__WINAPI set_epsel_func)(lprec *lp, REAL epsel);
typedef void (__WINAPI set_epsint_func)(lprec *lp, REAL epsint);
typedef MYBOOL (__WINAPI set_epslevel_func)(lprec *lp, int epslevel);
typedef void (__WINAPI set_epsperturb_func)(lprec *lp, REAL epsperturb);
typedef void (__WINAPI set_epspivot_func)(lprec *lp, REAL epspivot);
typedef MYBOOL (__WINAPI set_unbounded_func)(lprec *lp, int colnr);
typedef void (__WINAPI set_improve_func)(lprec *lp, int improve);