@@ -105,6 +105,7 @@ const HighsInt kHighsCallbackMipLogging = 5;
105
105
const HighsInt kHighsCallbackMipInterrupt = 6 ;
106
106
const HighsInt kHighsCallbackMipGetCutPool = 7 ;
107
107
const HighsInt kHighsCallbackMipDefineLazyConstraints = 8 ;
108
+ const HighsInt kHighsCallbackCallbackMipUserSolution = 9 ;
108
109
109
110
const char * const kHighsCallbackDataOutLogTypeName = "log_type" ;
110
111
const char * const kHighsCallbackDataOutRunningTimeName = "running_time" ;
@@ -770,7 +771,7 @@ HighsInt Highs_getStringOptionValue(const void* highs, const char* option,
770
771
*
771
772
* @param highs A pointer to the Highs instance.
772
773
* @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`
774
775
* constant should be placed.
775
776
*
776
777
* @returns A `kHighsStatus` constant indicating whether the call succeeded.
@@ -842,7 +843,7 @@ HighsInt Highs_getBoolOptionValues(const void* highs, const char* option,
842
843
HighsInt * current_value ,
843
844
HighsInt * default_value );
844
845
/**
845
- * Get the current and default values of an int option
846
+ * Get the current and default values of a HighsInt option
846
847
*
847
848
* @param highs A pointer to the Highs instance.
848
849
* @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,
924
925
*
925
926
* @param highs A pointer to the Highs instance.
926
927
* @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`
928
929
* constant is stored.
929
930
*
930
931
* @returns A `kHighsStatus` constant indicating whether the call succeeded.
@@ -983,7 +984,7 @@ HighsInt Highs_getModelStatus(const void* highs);
983
984
* LP) gets it if it does not and dual_ray_value is not nullptr.
984
985
*
985
986
* @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
987
988
* currently exists.
988
989
* @param dual_ray_value An array of length [num_row] filled with the
989
990
* unbounded ray.
@@ -1001,9 +1002,10 @@ HighsInt Highs_getDualRay(const void* highs, HighsInt* has_dual_ray,
1001
1002
*
1002
1003
* @param highs A pointer to the Highs
1003
1004
* 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.
1007
1009
* @param dual_unboundedness_direction_value An array of length [num_col]
1008
1010
* filled with the unboundedness
1009
1011
* direction.
@@ -1018,7 +1020,7 @@ HighsInt Highs_getDualUnboundednessDirection(
1018
1020
* LP) gets it if it does not and primal_ray_value is not nullptr.
1019
1021
*
1020
1022
* @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
1022
1024
* exists.
1023
1025
* @param primal_ray_value An array of length [num_col] filled with the
1024
1026
* unbounded ray.
@@ -1163,15 +1165,15 @@ HighsInt Highs_getBasisTransposeSolve(const void* highs, const double* rhs,
1163
1165
* See `Highs_getBasicVariables` for a description of the ``B`` matrix.
1164
1166
*
1165
1167
* 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
1167
1169
* actually stored.
1168
1170
*
1169
1171
* @param highs A pointer to the Highs instance.
1170
1172
* @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
1172
1174
* values of the non-zero elements.
1173
1175
* @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
1175
1177
* indices of the non-zero elements.
1176
1178
*
1177
1179
* @returns A `kHighsStatus` constant indicating whether the call succeeded.
@@ -1279,7 +1281,7 @@ HighsInt Highs_setCallback(void* highs, HighsCCallbackType user_callback,
1279
1281
*
1280
1282
* @returns A `kHighsStatus` constant indicating whether the call succeeded.
1281
1283
*/
1282
- HighsInt Highs_startCallback (void * highs , const int callback_type );
1284
+ HighsInt Highs_startCallback (void * highs , const HighsInt callback_type );
1283
1285
1284
1286
/**
1285
1287
* Stop callback of given type
@@ -1289,7 +1291,7 @@ HighsInt Highs_startCallback(void* highs, const int callback_type);
1289
1291
*
1290
1292
* @returns A `kHighsStatus` constant indicating whether the call succeeded.
1291
1293
*/
1292
- HighsInt Highs_stopCallback (void * highs , const int callback_type );
1294
+ HighsInt Highs_stopCallback (void * highs , const HighsInt callback_type );
1293
1295
1294
1296
/**
1295
1297
* Return the cumulative wall-clock time spent in `Highs_run`.
@@ -1670,6 +1672,24 @@ HighsInt Highs_changeColsBoundsByMask(void* highs, const HighsInt* mask,
1670
1672
HighsInt Highs_changeRowBounds (void * highs , const HighsInt row ,
1671
1673
const double lower , const double upper );
1672
1674
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
+
1673
1693
/**
1674
1694
* Change the bounds of multiple rows given by an array of indices.
1675
1695
*
@@ -1754,15 +1774,15 @@ HighsInt Highs_getObjectiveOffset(const void* highs, double* offset);
1754
1774
* @param highs A pointer to the Highs instance.
1755
1775
* @param from_col The first column for which to query data for.
1756
1776
* @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
1758
1778
* the model (this should equal `to_col - from_col + 1`).
1759
1779
* @param costs An array of size [to_col - from_col + 1] for the column
1760
1780
* cost coefficients.
1761
1781
* @param lower An array of size [to_col - from_col + 1] for the column
1762
1782
* lower bounds.
1763
1783
* @param upper An array of size [to_col - from_col + 1] for the column
1764
1784
* 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
1766
1786
* elements in the constraint matrix.
1767
1787
* @param matrix_start An array of size [to_col - from_col + 1] with the start
1768
1788
* indices of each column in `matrix_index` and
@@ -1831,13 +1851,13 @@ HighsInt Highs_getColsByMask(const void* highs, const HighsInt* mask,
1831
1851
* @param highs A pointer to the Highs instance.
1832
1852
* @param from_row The first row for which to query data for.
1833
1853
* @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
1835
1855
* from the model.
1836
1856
* @param lower An array of size [to_row - from_row + 1] for the row
1837
1857
* lower bounds.
1838
1858
* @param upper An array of size [to_row - from_row + 1] for the row
1839
1859
* 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
1841
1861
* elements in the constraint matrix.
1842
1862
* @param matrix_start An array of size [to_row - from_row + 1] with the start
1843
1863
* indices of each row in `matrix_index` and
@@ -1940,7 +1960,7 @@ HighsInt Highs_getColByName(const void* highs, const char* name, HighsInt* col);
1940
1960
* Get the integrality of a column.
1941
1961
*
1942
1962
* @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
1944
1964
* be placed. The integer is one of the `kHighsVarTypeXXX`
1945
1965
* constants.
1946
1966
*
@@ -1994,7 +2014,7 @@ HighsInt Highs_deleteColsByMask(void* highs, HighsInt* mask);
1994
2014
*
1995
2015
* @returns A `kHighsStatus` constant indicating whether the call succeeded.
1996
2016
*/
1997
- HighsInt Highs_deleteRowsByRange (void * highs , const int from_row ,
2017
+ HighsInt Highs_deleteRowsByRange (void * highs , const HighsInt from_row ,
1998
2018
const HighsInt to_row );
1999
2019
2000
2020
/**
@@ -2222,9 +2242,9 @@ HighsInt Highs_getPresolvedLp(const void* highs, const HighsInt a_format,
2222
2242
*
2223
2243
* @returns A `kHighsStatus` constant indicating whether the call succeeded.
2224
2244
*/
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 );
2228
2248
2229
2249
/**
2230
2250
* Compute the ranging information for all costs and bounds. For
@@ -2361,6 +2381,49 @@ void Highs_resetGlobalScheduler(const HighsInt blocking);
2361
2381
const void * Highs_getCallbackDataOutItem (const HighsCallbackDataOut * data_out ,
2362
2382
const char * item_name );
2363
2383
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
+
2364
2427
// *********************
2365
2428
// * Deprecated methods*
2366
2429
// *********************
0 commit comments