Skip to content

Commit 0d28e7a

Browse files
committed
merge latest
2 parents 5106cc1 + b161f68 commit 0d28e7a

File tree

4 files changed

+177
-273
lines changed

4 files changed

+177
-273
lines changed

FEATURES.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ The irreducible infeasibility system (IIS) facility now detects infeasibility du
1212

1313
Prompted by [#2463](https://github.com/ERGO-Code/HiGHS/issues/2463), the HiGHS solution and basis files now match data to any column and row names in the model, only assuming that the data are aligned with column and row indices if there are no names in the model. This requires a new version (v2) of the HiGHS basis file. Basis files from v1 are still read, but deprecated. Now, when writing out a model, basis or solution, column and row names are added to the model - previously they were created temporarily and inconsistentyly on the fly. If the model has existing names, then distinctive names are created to replace any blank names, but names with spaces or duplicate names yield an error status return.
1414

15-
<<<<<<< HEAD
15+
Refactored strong branching to minimize duplicated code
16+
1617
Only for LPs is there a choice of solver. Previously, when setting the `solver` option to anything other than "choose", any incumbent model was solved as an LP, using that LP solver. This has caused confusiuon for users, and is unnecessary now that there is the `solve_relaxation` option. Now, if the incumbent model is a QP or MIP, it is solved as such (unless `solve_relaxation` is true for a MIP), and the value of the `solver` option only determines what solver is used to solve an LP. If the value of `solver` is "choose", then HiGHS will use what it expects to be the best solver for the problem; if value of `solver` is "ipm", then HiGHS will use what it expects to be the better IPM solver (of HiPO and IPX) for the problem; if value of `solver` is "hipo", then HiGHS will use the HiPO IPM solver (if available in the build); if value of `solver` is "ipx", then HiGHS will use the IPX IPM solver; if value of `solver` is "pdlp", then HiGHS will use the PDLP first-order solver. The option `mip_lp_solver` has been introduced to define which LP solver is used when solving LPs in the MIP solver for which an advanced basis is not known - typically the "root node" LP. Note that The PDLP solver cannot be used to solve such LPs, since it does not yield a basic solution. If an interior point solver fails to obtain a basic solution, the simplex solver will then be used. The option `mip_ipm_solver` has been introduced to define which IPM solver is used when solving LPs in the MIP solver for which IPM is mandatory - typically the analytic centre calculation. When LPs are to be solved by an IPM solver, the HiPO solver is used (if available in the build) unless IPX has been specified explicitly.
1718

18-
=======
1919
As per [#2487](https://github.com/ERGO-Code/HiGHS/issues/2487), trivial heuristics now run before feasibility jump (FJ), and FJ will use any existing incumbent. FJ will clip any finite variable values in the incumbent to lower and upper bounds, and falls back to the existing logic (lower bound if finite, else upper bound if finite, else 0) for any infinite values in the incumbent.
20-
>>>>>>> latest
20+

examples/call_highs_from_csharp.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ static void Main(string[] args) {
1111
// minimize x_2 + (1/2)(2x_1^2 - 2x_1x_3 + 0.2x_2^2 + 2x_3^2)
1212
//
1313
// subject to x_1 + x_2 + x_3 >= 1; x>=0
14-
double[] cc = {0, 1, 0};
14+
double[] cc = {0, 1, 0};
1515
double[] cl = {0, 0, 0};
1616
double[] cu = {1.0e30, 1.0e30, 1.0e30};
1717
double[] rl = {1};
@@ -52,10 +52,10 @@ static void Main(string[] args) {
5252
Console.WriteLine("x" + i + " = " + sol.colvalue[i] + " is " + bas.colbasisstatus[i]);
5353
}
5454
// Add the Hessian
55-
int dim = 2;
56-
int[] qstart = {0, 2, 3};
57-
int[] qindex = {0, 1, 1};
58-
double[] qvalue = {2, -1, 2};
55+
int dim = 3;
56+
int[] qstart = {0, 2, 3, 4};
57+
int[] qindex = {0, 1, 1, 2};
58+
double[] qvalue = {2, -1, 0.2, 2};
5959
HessianFormat q_format = HessianFormat.kTriangular;
6060
HighsHessian hessian = new HighsHessian(dim, qstart, qindex, qvalue, q_format);
6161
status = solver.passHessian(hessian);

highs/interfaces/highs_c_api.h

Lines changed: 108 additions & 108 deletions
Original file line numberDiff line numberDiff line change
@@ -23,115 +23,115 @@
2323
//
2424
#include "lp_data/HighsCallbackStruct.h"
2525

26-
const HighsInt kHighsMaximumStringLength = 512;
27-
28-
const HighsInt kHighsStatusError = -1;
29-
const HighsInt kHighsStatusOk = 0;
30-
const HighsInt kHighsStatusWarning = 1;
31-
32-
const HighsInt kHighsVarTypeContinuous = 0;
33-
const HighsInt kHighsVarTypeInteger = 1;
34-
const HighsInt kHighsVarTypeSemiContinuous = 2;
35-
const HighsInt kHighsVarTypeSemiInteger = 3;
36-
const HighsInt kHighsVarTypeImplicitInteger = 4;
37-
38-
const HighsInt kHighsOptionTypeBool = 0;
39-
const HighsInt kHighsOptionTypeInt = 1;
40-
const HighsInt kHighsOptionTypeDouble = 2;
41-
const HighsInt kHighsOptionTypeString = 3;
42-
43-
const HighsInt kHighsInfoTypeInt64 = -1;
44-
const HighsInt kHighsInfoTypeInt = 1;
45-
const HighsInt kHighsInfoTypeDouble = 2;
46-
47-
const HighsInt kHighsObjSenseMinimize = 1;
48-
const HighsInt kHighsObjSenseMaximize = -1;
49-
50-
const HighsInt kHighsMatrixFormatColwise = 1;
51-
const HighsInt kHighsMatrixFormatRowwise = 2;
52-
53-
const HighsInt kHighsHessianFormatTriangular = 1;
54-
const HighsInt kHighsHessianFormatSquare = 2;
55-
56-
const HighsInt kHighsSolutionStatusNone = 0;
57-
const HighsInt kHighsSolutionStatusInfeasible = 1;
58-
const HighsInt kHighsSolutionStatusFeasible = 2;
59-
60-
const HighsInt kHighsBasisValidityInvalid = 0;
61-
const HighsInt kHighsBasisValidityValid = 1;
62-
63-
const HighsInt kHighsPresolveStatusNotPresolved = -1;
64-
const HighsInt kHighsPresolveStatusNotReduced = 0;
65-
const HighsInt kHighsPresolveStatusInfeasible = 1;
66-
const HighsInt kHighsPresolveStatusUnboundedOrInfeasible = 2;
67-
const HighsInt kHighsPresolveStatusReduced = 3;
68-
const HighsInt kHighsPresolveStatusReducedToEmpty = 4;
69-
const HighsInt kHighsPresolveStatusTimeout = 5;
70-
const HighsInt kHighsPresolveStatusNullError = 6;
71-
const HighsInt kHighsPresolveStatusOptionsError = 7;
72-
const HighsInt kHighsPresolveStatusOutOfMemory = 8;
73-
74-
const HighsInt kHighsModelStatusNotset = 0;
75-
const HighsInt kHighsModelStatusLoadError = 1;
76-
const HighsInt kHighsModelStatusModelError = 2;
77-
const HighsInt kHighsModelStatusPresolveError = 3;
78-
const HighsInt kHighsModelStatusSolveError = 4;
79-
const HighsInt kHighsModelStatusPostsolveError = 5;
80-
const HighsInt kHighsModelStatusModelEmpty = 6;
81-
const HighsInt kHighsModelStatusOptimal = 7;
82-
const HighsInt kHighsModelStatusInfeasible = 8;
83-
const HighsInt kHighsModelStatusUnboundedOrInfeasible = 9;
84-
const HighsInt kHighsModelStatusUnbounded = 10;
85-
const HighsInt kHighsModelStatusObjectiveBound = 11;
86-
const HighsInt kHighsModelStatusObjectiveTarget = 12;
87-
const HighsInt kHighsModelStatusTimeLimit = 13;
88-
const HighsInt kHighsModelStatusIterationLimit = 14;
89-
const HighsInt kHighsModelStatusUnknown = 15;
90-
const HighsInt kHighsModelStatusSolutionLimit = 16;
91-
const HighsInt kHighsModelStatusInterrupt = 17;
92-
93-
const HighsInt kHighsBasisStatusLower = 0;
94-
const HighsInt kHighsBasisStatusBasic = 1;
95-
const HighsInt kHighsBasisStatusUpper = 2;
96-
const HighsInt kHighsBasisStatusZero = 3;
97-
const HighsInt kHighsBasisStatusNonbasic = 4;
98-
99-
const HighsInt kHighsCallbackLogging = 0;
100-
const HighsInt kHighsCallbackSimplexInterrupt = 1;
101-
const HighsInt kHighsCallbackIpmInterrupt = 2;
102-
const HighsInt kHighsCallbackMipSolution = 3;
103-
const HighsInt kHighsCallbackMipImprovingSolution = 4;
104-
const HighsInt kHighsCallbackMipLogging = 5;
105-
const HighsInt kHighsCallbackMipInterrupt = 6;
106-
const HighsInt kHighsCallbackMipGetCutPool = 7;
107-
const HighsInt kHighsCallbackMipDefineLazyConstraints = 8;
108-
const HighsInt kHighsCallbackCallbackMipUserSolution = 9;
109-
110-
const char* const kHighsCallbackDataOutLogTypeName = "log_type";
111-
const char* const kHighsCallbackDataOutRunningTimeName = "running_time";
112-
const char* const kHighsCallbackDataOutSimplexIterationCountName =
26+
static const HighsInt kHighsMaximumStringLength = 512;
27+
28+
static const HighsInt kHighsStatusError = -1;
29+
static const HighsInt kHighsStatusOk = 0;
30+
static const HighsInt kHighsStatusWarning = 1;
31+
32+
static const HighsInt kHighsVarTypeContinuous = 0;
33+
static const HighsInt kHighsVarTypeInteger = 1;
34+
static const HighsInt kHighsVarTypeSemiContinuous = 2;
35+
static const HighsInt kHighsVarTypeSemiInteger = 3;
36+
static const HighsInt kHighsVarTypeImplicitInteger = 4;
37+
38+
static const HighsInt kHighsOptionTypeBool = 0;
39+
static const HighsInt kHighsOptionTypeInt = 1;
40+
static const HighsInt kHighsOptionTypeDouble = 2;
41+
static const HighsInt kHighsOptionTypeString = 3;
42+
43+
static const HighsInt kHighsInfoTypeInt64 = -1;
44+
static const HighsInt kHighsInfoTypeInt = 1;
45+
static const HighsInt kHighsInfoTypeDouble = 2;
46+
47+
static const HighsInt kHighsObjSenseMinimize = 1;
48+
static const HighsInt kHighsObjSenseMaximize = -1;
49+
50+
static const HighsInt kHighsMatrixFormatColwise = 1;
51+
static const HighsInt kHighsMatrixFormatRowwise = 2;
52+
53+
static const HighsInt kHighsHessianFormatTriangular = 1;
54+
static const HighsInt kHighsHessianFormatSquare = 2;
55+
56+
static const HighsInt kHighsSolutionStatusNone = 0;
57+
static const HighsInt kHighsSolutionStatusInfeasible = 1;
58+
static const HighsInt kHighsSolutionStatusFeasible = 2;
59+
60+
static const HighsInt kHighsBasisValidityInvalid = 0;
61+
static const HighsInt kHighsBasisValidityValid = 1;
62+
63+
static const HighsInt kHighsPresolveStatusNotPresolved = -1;
64+
static const HighsInt kHighsPresolveStatusNotReduced = 0;
65+
static const HighsInt kHighsPresolveStatusInfeasible = 1;
66+
static const HighsInt kHighsPresolveStatusUnboundedOrInfeasible = 2;
67+
static const HighsInt kHighsPresolveStatusReduced = 3;
68+
static const HighsInt kHighsPresolveStatusReducedToEmpty = 4;
69+
static const HighsInt kHighsPresolveStatusTimeout = 5;
70+
static const HighsInt kHighsPresolveStatusNullError = 6;
71+
static const HighsInt kHighsPresolveStatusOptionsError = 7;
72+
static const HighsInt kHighsPresolveStatusOutOfMemory = 8;
73+
74+
static const HighsInt kHighsModelStatusNotset = 0;
75+
static const HighsInt kHighsModelStatusLoadError = 1;
76+
static const HighsInt kHighsModelStatusModelError = 2;
77+
static const HighsInt kHighsModelStatusPresolveError = 3;
78+
static const HighsInt kHighsModelStatusSolveError = 4;
79+
static const HighsInt kHighsModelStatusPostsolveError = 5;
80+
static const HighsInt kHighsModelStatusModelEmpty = 6;
81+
static const HighsInt kHighsModelStatusOptimal = 7;
82+
static const HighsInt kHighsModelStatusInfeasible = 8;
83+
static const HighsInt kHighsModelStatusUnboundedOrInfeasible = 9;
84+
static const HighsInt kHighsModelStatusUnbounded = 10;
85+
static const HighsInt kHighsModelStatusObjectiveBound = 11;
86+
static const HighsInt kHighsModelStatusObjectiveTarget = 12;
87+
static const HighsInt kHighsModelStatusTimeLimit = 13;
88+
static const HighsInt kHighsModelStatusIterationLimit = 14;
89+
static const HighsInt kHighsModelStatusUnknown = 15;
90+
static const HighsInt kHighsModelStatusSolutionLimit = 16;
91+
static const HighsInt kHighsModelStatusInterrupt = 17;
92+
93+
static const HighsInt kHighsBasisStatusLower = 0;
94+
static const HighsInt kHighsBasisStatusBasic = 1;
95+
static const HighsInt kHighsBasisStatusUpper = 2;
96+
static const HighsInt kHighsBasisStatusZero = 3;
97+
static const HighsInt kHighsBasisStatusNonbasic = 4;
98+
99+
static const HighsInt kHighsCallbackLogging = 0;
100+
static const HighsInt kHighsCallbackSimplexInterrupt = 1;
101+
static const HighsInt kHighsCallbackIpmInterrupt = 2;
102+
static const HighsInt kHighsCallbackMipSolution = 3;
103+
static const HighsInt kHighsCallbackMipImprovingSolution = 4;
104+
static const HighsInt kHighsCallbackMipLogging = 5;
105+
static const HighsInt kHighsCallbackMipInterrupt = 6;
106+
static const HighsInt kHighsCallbackMipGetCutPool = 7;
107+
static const HighsInt kHighsCallbackMipDefineLazyConstraints = 8;
108+
static const HighsInt kHighsCallbackCallbackMipUserSolution = 9;
109+
110+
static const char* const kHighsCallbackDataOutLogTypeName = "log_type";
111+
static const char* const kHighsCallbackDataOutRunningTimeName = "running_time";
112+
static const char* const kHighsCallbackDataOutSimplexIterationCountName =
113113
"simplex_iteration_count";
114-
const char* const kHighsCallbackDataOutIpmIterationCountName =
114+
static const char* const kHighsCallbackDataOutIpmIterationCountName =
115115
"ipm_iteration_count";
116-
const char* const kHighsCallbackDataOutPdlpIterationCountName =
116+
static const char* const kHighsCallbackDataOutPdlpIterationCountName =
117117
"pdlp_iteration_count";
118-
const char* const kHighsCallbackDataOutObjectiveFunctionValueName =
118+
static const char* const kHighsCallbackDataOutObjectiveFunctionValueName =
119119
"objective_function_value";
120-
const char* const kHighsCallbackDataOutMipNodeCountName = "mip_node_count";
121-
const char* const kHighsCallbackDataOutMipTotalLpIterationsName =
120+
static const char* const kHighsCallbackDataOutMipNodeCountName = "mip_node_count";
121+
static const char* const kHighsCallbackDataOutMipTotalLpIterationsName =
122122
"mip_total_lp_iterations";
123-
const char* const kHighsCallbackDataOutMipPrimalBoundName = "mip_primal_bound";
124-
const char* const kHighsCallbackDataOutMipDualBoundName = "mip_dual_bound";
125-
const char* const kHighsCallbackDataOutMipGapName = "mip_gap";
126-
const char* const kHighsCallbackDataOutMipSolutionName = "mip_solution";
127-
const char* const kHighsCallbackDataOutCutpoolNumColName = "cutpool_num_col";
128-
const char* const kHighsCallbackDataOutCutpoolNumCutName = "cutpool_num_cut";
129-
const char* const kHighsCallbackDataOutCutpoolNumNzName = "cutpool_num_nz";
130-
const char* const kHighsCallbackDataOutCutpoolStartName = "cutpool_start";
131-
const char* const kHighsCallbackDataOutCutpoolIndexName = "cutpool_index";
132-
const char* const kHighsCallbackDataOutCutpoolValueName = "cutpool_value";
133-
const char* const kHighsCallbackDataOutCutpoolLowerName = "cutpool_lower";
134-
const char* const kHighsCallbackDataOutCutpoolUpperName = "cutpool_upper";
123+
static const char* const kHighsCallbackDataOutMipPrimalBoundName = "mip_primal_bound";
124+
static const char* const kHighsCallbackDataOutMipDualBoundName = "mip_dual_bound";
125+
static const char* const kHighsCallbackDataOutMipGapName = "mip_gap";
126+
static const char* const kHighsCallbackDataOutMipSolutionName = "mip_solution";
127+
static const char* const kHighsCallbackDataOutCutpoolNumColName = "cutpool_num_col";
128+
static const char* const kHighsCallbackDataOutCutpoolNumCutName = "cutpool_num_cut";
129+
static const char* const kHighsCallbackDataOutCutpoolNumNzName = "cutpool_num_nz";
130+
static const char* const kHighsCallbackDataOutCutpoolStartName = "cutpool_start";
131+
static const char* const kHighsCallbackDataOutCutpoolIndexName = "cutpool_index";
132+
static const char* const kHighsCallbackDataOutCutpoolValueName = "cutpool_value";
133+
static const char* const kHighsCallbackDataOutCutpoolLowerName = "cutpool_lower";
134+
static const char* const kHighsCallbackDataOutCutpoolUpperName = "cutpool_upper";
135135

136136
const HighsInt kHighsIisStrategyLight = 0;
137137
const HighsInt kHighsIisStrategyFromLpRowPriority = 1; // WIP
@@ -2527,13 +2527,13 @@ HighsInt Highs_repairCallbackSolution(HighsCallbackDataIn* data_in);
25272527
*
25282528
* @returns Thse HiGHS compilation date.
25292529
*/
2530-
const char* Highs_compilationDate(void);
2530+
static const char* Highs_compilationDate(void);
25312531

25322532
// These are deprecated because they don't follow the style guide. Constants
25332533
// must begin with `k`.
2534-
const HighsInt HighsStatuskError = -1;
2535-
const HighsInt HighsStatuskOk = 0;
2536-
const HighsInt HighsStatuskWarning = 1;
2534+
static const HighsInt HighsStatuskError = -1;
2535+
static const HighsInt HighsStatuskOk = 0;
2536+
static const HighsInt HighsStatuskWarning = 1;
25372537

25382538
HighsInt Highs_call(const HighsInt num_col, const HighsInt num_row,
25392539
const HighsInt num_nz, const double* col_cost,

0 commit comments

Comments
 (0)