Skip to content

Commit 537a4ad

Browse files
committed
Update highs header to 1.11.0
1 parent 11c55e9 commit 537a4ad

36 files changed

+1430
-185
lines changed

thirdparty/solvers/highs/HConfig.h

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,19 +5,16 @@
55
/* #undef ZLIB_FOUND */
66
#define CUPDLP_CPU
77
/* #undef CUPDLP_GPU */
8-
/* #undef CUPDLP_FORCE_NATIVE */
98
#define CMAKE_BUILD_TYPE "Release"
10-
#define CMAKE_INSTALL_PREFIX "E:/HiGHS/build/install"
119
/* #undef HIGHSINT64 */
1210
/* #undef HIGHS_NO_DEFAULT_THREADS */
1311
#define HIGHS_HAVE_MM_PAUSE
1412
/* #undef HIGHS_HAVE_BUILTIN_CLZ */
1513
#define HIGHS_HAVE_BITSCAN_REVERSE
1614

17-
#define HIGHS_GITHASH "fd8665394"
15+
#define HIGHS_GITHASH "364c83a51"
1816
#define HIGHS_VERSION_MAJOR 1
19-
#define HIGHS_VERSION_MINOR 10
17+
#define HIGHS_VERSION_MINOR 11
2018
#define HIGHS_VERSION_PATCH 0
21-
#define HIGHS_DIR "E:/HiGHS"
2219

2320
#endif /* HCONFIG_H_ */

thirdparty/solvers/highs/Highs.h

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,6 +1459,7 @@ class Highs {
14591459
HighsRanging ranging_;
14601460
HighsIis iis_;
14611461
std::vector<HighsObjectiveSolution> saved_objective_and_solution_;
1462+
HighsFiles files_;
14621463

14631464
HighsPresolveStatus model_presolve_status_ =
14641465
HighsPresolveStatus::kNotPresolved;
@@ -1476,16 +1477,16 @@ class Highs {
14761477

14771478
HighsInt max_threads = 0;
14781479
// This is strictly for debugging. It's used to check whether
1479-
// returnFromRun() was called after the previous call to
1480-
// Highs::run() and, assuming that this is always done, it checks
1481-
// whether Highs::run() is called recursively.
1482-
bool called_return_from_run = true;
1483-
HighsInt debug_run_call_num_ = 0;
1480+
// returnFromOptimizeModel() was called after the previous call to
1481+
// Highs::optimizeModel() and, assuming that this is always done, it checks
1482+
// whether Highs::optimizeModel() is called recursively.
1483+
bool called_return_from_optimize_model = true;
1484+
HighsInt debug_optimize_call_num_ = 0;
14841485

14851486
bool written_log_header_ = false;
14861487

14871488
void reportModelStats() const;
1488-
HighsStatus solve();
1489+
HighsStatus optimizeModel();
14891490

14901491
void exactResizeModel() {
14911492
this->model_.lp_.exactResize();
@@ -1568,8 +1569,8 @@ class Highs {
15681569

15691570
HighsStatus returnFromWriteSolution(FILE* file,
15701571
const HighsStatus return_status);
1571-
HighsStatus returnFromRun(const HighsStatus return_status,
1572-
const bool undo_mods);
1572+
HighsStatus returnFromOptimizeModel(const HighsStatus return_status,
1573+
const bool undo_mods);
15731574
HighsStatus returnFromHighs(const HighsStatus return_status);
15741575
void reportSolvedLpQpStats();
15751576

@@ -1673,6 +1674,7 @@ class Highs {
16731674
bool qFormatOk(const HighsInt num_nz, const HighsInt format);
16741675
void clearZeroHessian();
16751676
HighsStatus checkOptimality(const std::string& solver_type);
1677+
HighsStatus lpKktCheck(const std::string& message);
16761678
HighsStatus invertRequirementError(std::string method_name) const;
16771679

16781680
HighsStatus handleInfCost();
@@ -1694,6 +1696,13 @@ class Highs {
16941696
const HighsInt iObj) const;
16951697
bool hasRepeatedLinearObjectivePriorities(
16961698
const HighsLinearObjective* linear_objective = nullptr) const;
1699+
1700+
bool tryPdlpCleanup(HighsInt& pdlp_cleanup_iteration_limit,
1701+
const HighsInfo& presolved_lp_info) const;
1702+
1703+
bool optionsHasHighsFiles() const;
1704+
void saveHighsFiles();
1705+
void getHighsFiles();
16971706
};
16981707

16991708
// Start of deprecated methods not in the Highs class

thirdparty/solvers/highs/interfaces/highs_c_api.h

Lines changed: 85 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ const HighsInt kHighsCallbackMipLogging = 5;
105105
const HighsInt kHighsCallbackMipInterrupt = 6;
106106
const HighsInt kHighsCallbackMipGetCutPool = 7;
107107
const HighsInt kHighsCallbackMipDefineLazyConstraints = 8;
108+
const HighsInt kHighsCallbackCallbackMipUserSolution = 9;
108109

109110
const char* const kHighsCallbackDataOutLogTypeName = "log_type";
110111
const char* const kHighsCallbackDataOutRunningTimeName = "running_time";
@@ -770,7 +771,7 @@ HighsInt Highs_getStringOptionValue(const void* highs, const char* option,
770771
*
771772
* @param highs A pointer to the Highs instance.
772773
* @param option The name of the option.
773-
* @param type An int in which the corresponding `kHighsOptionType`
774+
* @param type A HighsInt in which the corresponding `kHighsOptionType`
774775
* constant should be placed.
775776
*
776777
* @returns A `kHighsStatus` constant indicating whether the call succeeded.
@@ -842,7 +843,7 @@ HighsInt Highs_getBoolOptionValues(const void* highs, const char* option,
842843
HighsInt* current_value,
843844
HighsInt* default_value);
844845
/**
845-
* Get the current and default values of an int option
846+
* Get the current and default values of a HighsInt option
846847
*
847848
* @param highs A pointer to the Highs instance.
848849
* @param current_value A pointer to the current value of the option.
@@ -924,7 +925,7 @@ HighsInt Highs_getInt64InfoValue(const void* highs, const char* info,
924925
*
925926
* @param highs A pointer to the Highs instance.
926927
* @param info The name of the info item.
927-
* @param type An int in which the corresponding `kHighsOptionType`
928+
* @param type A HighsInt in which the corresponding `kHighsOptionType`
928929
* constant is stored.
929930
*
930931
* @returns A `kHighsStatus` constant indicating whether the call succeeded.
@@ -983,7 +984,7 @@ HighsInt Highs_getModelStatus(const void* highs);
983984
* LP) gets it if it does not and dual_ray_value is not nullptr.
984985
*
985986
* @param highs A pointer to the Highs instance.
986-
* @param has_dual_ray A pointer to an int to store 1 if a dual ray
987+
* @param has_dual_ray A pointer to a HighsInt to store 1 if a dual ray
987988
* currently exists.
988989
* @param dual_ray_value An array of length [num_row] filled with the
989990
* unbounded ray.
@@ -1001,9 +1002,10 @@ HighsInt Highs_getDualRay(const void* highs, HighsInt* has_dual_ray,
10011002
*
10021003
* @param highs A pointer to the Highs
10031004
* instance.
1004-
* @param has_dual_unboundedness_direction A pointer to an int to store 1
1005-
* if the dual unboundedness
1006-
* direction exists.
1005+
* @param has_dual_unboundedness_direction A pointer to a HighsInt to
1006+
* store 1 if the dual
1007+
* unboundedness direction
1008+
* exists.
10071009
* @param dual_unboundedness_direction_value An array of length [num_col]
10081010
* filled with the unboundedness
10091011
* direction.
@@ -1018,7 +1020,7 @@ HighsInt Highs_getDualUnboundednessDirection(
10181020
* LP) gets it if it does not and primal_ray_value is not nullptr.
10191021
*
10201022
* @param highs A pointer to the Highs instance.
1021-
* @param has_primal_ray A pointer to an int to store 1 if the primal ray
1023+
* @param has_primal_ray A pointer to a HighsInt to store 1 if the primal ray
10221024
* exists.
10231025
* @param primal_ray_value An array of length [num_col] filled with the
10241026
* unbounded ray.
@@ -1163,15 +1165,15 @@ HighsInt Highs_getBasisTransposeSolve(const void* highs, const double* rhs,
11631165
* See `Highs_getBasicVariables` for a description of the ``B`` matrix.
11641166
*
11651167
* The arrays `row_vector` and `row_index` must have an allocated length of
1166-
* [num_row]. However, check `row_num_nz` to see how many non-zero elements are
1168+
* [num_col]. However, check `row_num_nz` to see how many non-zero elements are
11671169
* actually stored.
11681170
*
11691171
* @param highs A pointer to the Highs instance.
11701172
* @param row The index of the row to compute.
1171-
* @param row_vector An array of length [num_row] in which to store the
1173+
* @param row_vector An array of length [num_col] in which to store the
11721174
* values of the non-zero elements.
11731175
* @param row_num_nz The number of non-zeros in the row.
1174-
* @param row_index An array of length [num_row] in which to store the
1176+
* @param row_index An array of length [num_col] in which to store the
11751177
* indices of the non-zero elements.
11761178
*
11771179
* @returns A `kHighsStatus` constant indicating whether the call succeeded.
@@ -1279,7 +1281,7 @@ HighsInt Highs_setCallback(void* highs, HighsCCallbackType user_callback,
12791281
*
12801282
* @returns A `kHighsStatus` constant indicating whether the call succeeded.
12811283
*/
1282-
HighsInt Highs_startCallback(void* highs, const int callback_type);
1284+
HighsInt Highs_startCallback(void* highs, const HighsInt callback_type);
12831285

12841286
/**
12851287
* Stop callback of given type
@@ -1289,7 +1291,7 @@ HighsInt Highs_startCallback(void* highs, const int callback_type);
12891291
*
12901292
* @returns A `kHighsStatus` constant indicating whether the call succeeded.
12911293
*/
1292-
HighsInt Highs_stopCallback(void* highs, const int callback_type);
1294+
HighsInt Highs_stopCallback(void* highs, const HighsInt callback_type);
12931295

12941296
/**
12951297
* Return the cumulative wall-clock time spent in `Highs_run`.
@@ -1670,6 +1672,24 @@ HighsInt Highs_changeColsBoundsByMask(void* highs, const HighsInt* mask,
16701672
HighsInt Highs_changeRowBounds(void* highs, const HighsInt row,
16711673
const double lower, const double upper);
16721674

1675+
/**
1676+
* Change the variable bounds of multiple adjacent rows.
1677+
*
1678+
* @param highs A pointer to the Highs instance.
1679+
* @param from_row The index of the first row whose bound changes.
1680+
* @param to_row The index of the last row whose bound changes.
1681+
* @param lower An array of length [to_row - from_row + 1] with the new
1682+
* lower bounds.
1683+
* @param upper An array of length [to_row - from_row + 1] with the new
1684+
* upper bounds.
1685+
*
1686+
* @returns A `kHighsStatus` constant indicating whether the call succeeded.
1687+
*/
1688+
HighsInt Highs_changeRowsBoundsByRange(void* highs, const HighsInt from_row,
1689+
const HighsInt to_row,
1690+
const double* lower,
1691+
const double* upper);
1692+
16731693
/**
16741694
* Change the bounds of multiple rows given by an array of indices.
16751695
*
@@ -1754,15 +1774,15 @@ HighsInt Highs_getObjectiveOffset(const void* highs, double* offset);
17541774
* @param highs A pointer to the Highs instance.
17551775
* @param from_col The first column for which to query data for.
17561776
* @param to_col The last column (inclusive) for which to query data for.
1757-
* @param num_col An integer populated with the number of columns got from
1777+
* @param num_col A HighsInt populated with the number of columns got from
17581778
* the model (this should equal `to_col - from_col + 1`).
17591779
* @param costs An array of size [to_col - from_col + 1] for the column
17601780
* cost coefficients.
17611781
* @param lower An array of size [to_col - from_col + 1] for the column
17621782
* lower bounds.
17631783
* @param upper An array of size [to_col - from_col + 1] for the column
17641784
* upper bounds.
1765-
* @param num_nz An integer to be populated with the number of non-zero
1785+
* @param num_nz A HighsInt to be populated with the number of non-zero
17661786
* elements in the constraint matrix.
17671787
* @param matrix_start An array of size [to_col - from_col + 1] with the start
17681788
* indices of each column in `matrix_index` and
@@ -1831,13 +1851,13 @@ HighsInt Highs_getColsByMask(const void* highs, const HighsInt* mask,
18311851
* @param highs A pointer to the Highs instance.
18321852
* @param from_row The first row for which to query data for.
18331853
* @param to_row The last row (inclusive) for which to query data for.
1834-
* @param num_row An integer to be populated with the number of rows got
1854+
* @param num_row A HighsInt to be populated with the number of rows got
18351855
* from the model.
18361856
* @param lower An array of size [to_row - from_row + 1] for the row
18371857
* lower bounds.
18381858
* @param upper An array of size [to_row - from_row + 1] for the row
18391859
* upper bounds.
1840-
* @param num_nz An integer to be populated with the number of non-zero
1860+
* @param num_nz A HighsInt to be populated with the number of non-zero
18411861
* elements in the constraint matrix.
18421862
* @param matrix_start An array of size [to_row - from_row + 1] with the start
18431863
* indices of each row in `matrix_index` and
@@ -1940,7 +1960,7 @@ HighsInt Highs_getColByName(const void* highs, const char* name, HighsInt* col);
19401960
* Get the integrality of a column.
19411961
*
19421962
* @param col The index of the column to query.
1943-
* @param integrality An integer in which the integrality of the column should
1963+
* @param integrality A HighsInt in which the integrality of the column should
19441964
* be placed. The integer is one of the `kHighsVarTypeXXX`
19451965
* constants.
19461966
*
@@ -1994,7 +2014,7 @@ HighsInt Highs_deleteColsByMask(void* highs, HighsInt* mask);
19942014
*
19952015
* @returns A `kHighsStatus` constant indicating whether the call succeeded.
19962016
*/
1997-
HighsInt Highs_deleteRowsByRange(void* highs, const int from_row,
2017+
HighsInt Highs_deleteRowsByRange(void* highs, const HighsInt from_row,
19982018
const HighsInt to_row);
19992019

20002020
/**
@@ -2222,9 +2242,9 @@ HighsInt Highs_getPresolvedLp(const void* highs, const HighsInt a_format,
22222242
*
22232243
* @returns A `kHighsStatus` constant indicating whether the call succeeded.
22242244
*/
2225-
HighsInt Highs_crossover(void* highs, const int num_col, const int num_row,
2226-
const double* col_value, const double* col_dual,
2227-
const double* row_dual);
2245+
HighsInt Highs_crossover(void* highs, const HighsInt num_col,
2246+
const HighsInt num_row, const double* col_value,
2247+
const double* col_dual, const double* row_dual);
22282248

22292249
/**
22302250
* Compute the ranging information for all costs and bounds. For
@@ -2361,6 +2381,49 @@ void Highs_resetGlobalScheduler(const HighsInt blocking);
23612381
const void* Highs_getCallbackDataOutItem(const HighsCallbackDataOut* data_out,
23622382
const char* item_name);
23632383

2384+
/**
2385+
* Set a solution within a callback by passing a subset of the values.
2386+
*
2387+
* For any values that are unavailable/unknown, pass kHighsUndefined.
2388+
*
2389+
* @param data_in A pointer to the callback input data instance.
2390+
* @param num_entries Number of variables in the set
2391+
* @param value An array of length [num_entries <= num_col] with
2392+
* column solution values.
2393+
*
2394+
* @returns A `kHighsStatus` constant indicating whether the call succeeded.
2395+
*/
2396+
HighsInt Highs_setCallbackSolution(HighsCallbackDataIn* data_in,
2397+
const HighsInt num_entries,
2398+
const double* value);
2399+
2400+
/**
2401+
* Set a partial primal solution by passing values for a set of variables,
2402+
* within a valid callback.
2403+
*
2404+
* @param data_in A pointer to the callback input data instance.
2405+
* @param num_entries Number of variables in the set
2406+
* @param index Indices of variables in the set
2407+
* @param value Values of variables in the set
2408+
*
2409+
* @returns A `kHighsStatus` constant indicating whether the call succeeded.
2410+
*/
2411+
HighsInt Highs_setCallbackSparseSolution(HighsCallbackDataIn* data_in,
2412+
const HighsInt num_entries,
2413+
const HighsInt* index,
2414+
const double* value);
2415+
2416+
/**
2417+
* Finds a feasible solution for a given (partial) primal user solution,
2418+
* within a valid callback.
2419+
*
2420+
* On success, the user solution is updated within the callback input data
2421+
* instance.
2422+
*
2423+
* @returns A `kHighsStatus` constant indicating whether the call succeeded.
2424+
*/
2425+
HighsInt Highs_repairCallbackSolution(HighsCallbackDataIn* data_in);
2426+
23642427
// *********************
23652428
// * Deprecated methods*
23662429
// *********************

thirdparty/solvers/highs/io/HMpsFF.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ class HMpsFF {
164164

165165
enum class Boundtype { kLe, kEq, kGe }; //, kFr };
166166

167-
// see https://docs.mosek.com/latest/capi/mps-format.html#csection-optional
167+
// see
168+
// https://docs.mosek.com/latest_kkt/capi/mps-format.html#csection-optional
168169
enum class ConeType { kZero, kQuad, kRQuad, kPExp, kPPow, kDExp, kDPow };
169170

170171
std::string objective_name;

thirdparty/solvers/highs/io/HighsIO.h

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -44,9 +44,7 @@ struct HighsLogOptions {
4444
HighsInt* log_dev_level;
4545
void (*user_log_callback)(HighsLogType, const char*, void*);
4646
void* user_log_callback_data;
47-
std::function<void(int, const std::string&, const HighsCallbackDataOut*,
48-
HighsCallbackDataIn*, void*)>
49-
user_callback;
47+
HighsCallbackFunctionType user_callback;
5048
void* user_callback_data;
5149
bool user_callback_active;
5250
void clear();

thirdparty/solvers/highs/ipm/ipx/ipx_c.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
extern "C"{
1111
#endif
1212
/* These functions call their equivalent method of LpSolver for
13-
the object pointed to by @self. See src/lp_solver.h for
13+
the object pointed to by @self. See highs/lp_solver.h for
1414
documentation of the methods. */
1515
ipxint ipx_load_model(void* self, ipxint num_var, const double* obj,
1616
const double* lb, const double* ub, ipxint num_constr,

thirdparty/solvers/highs/ipm/ipx/ipx_internal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ struct Parameters : public ipx_parameters {
5555
centring_alpha_scaling = 0.5;
5656
bad_products_tolerance = 3;
5757
highs_logging = false;
58+
timeless_log = false;
5859
log_options = nullptr;
5960
}
6061

0 commit comments

Comments
 (0)