@@ -105,6 +105,7 @@ const HighsInt kHighsCallbackMipLogging = 5;
105105const HighsInt kHighsCallbackMipInterrupt = 6 ;
106106const HighsInt kHighsCallbackMipGetCutPool = 7 ;
107107const HighsInt kHighsCallbackMipDefineLazyConstraints = 8 ;
108+ const HighsInt kHighsCallbackCallbackMipUserSolution = 9 ;
108109
109110const char * const kHighsCallbackDataOutLogTypeName = "log_type" ;
110111const 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,
16701672HighsInt 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);
23612381const 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// *********************
0 commit comments