@@ -114,9 +114,9 @@ cuopt_int_t cuOptReadProblem(const char* filename, cuOptOptimizationProblem* pro
114114/** @brief Create an optimization problem of the form
115115 *
116116 * @verbatim
117- * minimize/maximize cᵀx + offset
118- * subject to A x {=, ≤, ≥ } b
119- * l ≤ x ≤ u
117+ * minimize/maximize c^T x + offset
118+ * subject to A x {=, <=, >= } b
119+ * l <= x <= u
120120 * x_i integer for some i
121121 * @endverbatim
122122 *
@@ -238,6 +238,160 @@ cuopt_int_t cuOptCreateRangedProblem(cuopt_int_t num_constraints,
238238 const char * variable_types ,
239239 cuOptOptimizationProblem * problem_ptr );
240240
241+ /** @brief Create an optimization problem of the form
242+ *
243+ * @verbatim
244+ * minimize/maximize c^T x + x^T Q x + offset
245+ * subject to A x {=, <=, >=} b
246+ * l ≤ x ≤ u
247+ * @endverbatim
248+ *
249+ * @param[in] num_constraints The number of constraints
250+ * @param[in] num_variables The number of variables
251+ * @param[in] objective_sense The objective sense (CUOPT_MINIMIZE for
252+ * minimization or CUOPT_MAXIMIZE for maximization)
253+ * @param[in] objective_offset An offset to add to the linear objective
254+ * @param[in] objective_coefficients A pointer to an array of type cuopt_float_t
255+ * of size num_variables containing the coefficients of the linear objective
256+ * @param[in] quadratic_objective_matrix_row_offsets A pointer to an array of type
257+ * cuopt_int_t of size num_variables + 1. quadratic_objective_matrix_row_offsets[i] is
258+ * the index of the first non-zero element of the i-th row of the quadratic objective matrix in
259+ * quadratic_objective_matrix_column_indices and
260+ * quadratic_objective_matrix_coefficent_values. This is part of the compressed sparse row
261+ * representation of the quadratic objective matrix.
262+ * @param[in] quadratic_objective_matrix_column_indices A pointer to an array of type
263+ * cuopt_int_t of size quadratic_objective_matrix_row_offsets[num_variables] containing
264+ * the column indices of the non-zero elements of the quadratic objective matrix.
265+ * This is part of the compressed sparse row representation of the quadratic objective
266+ * matrix.
267+ * @param[in] quadratic_objective_matrix_coefficent_values A pointer to an array of type
268+ * cuopt_float_t of size quadratic_objective_matrix_row_offsets[num_variables] containing
269+ * the values of the non-zero elements of the quadratic objective matrix.
270+ * @param[in] constraint_matrix_row_offsets A pointer to an array of type
271+ * cuopt_int_t of size num_constraints + 1. constraint_matrix_row_offsets[i] is the
272+ * index of the first non-zero element of the i-th constraint in
273+ * constraint_matrix_column_indices and constraint_matrix_coefficent_values. This is
274+ * part of the compressed sparse row representation of the constraint matrix
275+ * @param[in] constraint_matrix_column_indices A pointer to an array of type
276+ * cuopt_int_t of size constraint_matrix_row_offsets[num_constraints] containing
277+ * the column indices of the non-zero elements of the constraint matrix. This is
278+ * part of the compressed sparse row representation of the constraint matrix
279+ * @param[in] constraint_matrix_coefficent_values A pointer to an array of type
280+ * cuopt_float_t of size constraint_matrix_row_offsets[num_constraints] containing
281+ * the values of the non-zero elements of the constraint matrix. This is
282+ * part of the compressed sparse row representation of the constraint matrix
283+ * @param[in] constraint_sense A pointer to an array of type char of size
284+ * num_constraints containing the sense of the constraints (CUOPT_LESS_THAN,
285+ * CUOPT_GREATER_THAN, or CUOPT_EQUAL)
286+ * @param[in] rhs A pointer to an array of type cuopt_float_t of size num_constraints
287+ * containing the right-hand side of the constraints
288+ * @param[in] lower_bounds A pointer to an array of type cuopt_float_t of size num_variables
289+ * containing the lower bounds of the variables
290+ * @param[in] upper_bounds A pointer to an array of type cuopt_float_t of size num_variables
291+ * containing the upper bounds of the variables
292+ * @param[out] problem_ptr Pointer to store the created optimization problem
293+ * @return CUOPT_SUCCESS if successful, CUOPT_ERROR otherwise
294+ */
295+ cuopt_int_t cuOptCreateQuadraticProblem (
296+ cuopt_int_t num_constraints ,
297+ cuopt_int_t num_variables ,
298+ cuopt_int_t objective_sense ,
299+ cuopt_float_t objective_offset ,
300+ const cuopt_float_t * objective_coefficients ,
301+ const cuopt_int_t * quadratic_objective_matrix_row_offsets ,
302+ const cuopt_int_t * quadratic_objective_matrix_column_indices ,
303+ const cuopt_float_t * quadratic_objective_matrix_coefficent_values ,
304+ const cuopt_int_t * constraint_matrix_row_offsets ,
305+ const cuopt_int_t * constraint_matrix_column_indices ,
306+ const cuopt_float_t * constraint_matrix_coefficent_values ,
307+ const char * constraint_sense ,
308+ const cuopt_float_t * rhs ,
309+ const cuopt_float_t * lower_bounds ,
310+ const cuopt_float_t * upper_bounds ,
311+ cuOptOptimizationProblem * problem_ptr );
312+
313+ /** @brief Create an optimization problem of the form *
314+ * @verbatim
315+ * minimize/maximize c^T x + x^T Q x + offset
316+ * subject to bl <= A*x <= bu
317+ * l <= x <= u
318+ * @endverbatim
319+ *
320+ * @param[in] num_constraints - The number of constraints.
321+ *
322+ * @param[in] num_variables - The number of variables.
323+ *
324+ * @param[in] objective_sense - The objective sense (CUOPT_MINIMIZE for
325+ * minimization or CUOPT_MAXIMIZE for maximization)
326+ *
327+ * @param[in] objective_offset - An offset to add to the linear objective.
328+ *
329+ * @param[in] objective_coefficients - A pointer to an array of type cuopt_float_t
330+ * of size num_variables containing the coefficients of the linear objective.
331+ *
332+ * @param[in] quadratic_objective_matrix_row_offsets - A pointer to an array of type
333+ * cuopt_int_t of size num_variables + 1. quadratic_objective_matrix_row_offsets[i] is the
334+ * index of the first non-zero element of the i-th row of the quadratic objective matrix in
335+ * quadratic_objective_matrix_column_indices and quadratic_objective_matrix_coefficent_values.
336+ * This is part of the compressed sparse row representation of the quadratic objective matrix.
337+ *
338+ * @param[in] quadratic_objective_matrix_column_indices - A pointer to an array of type
339+ * cuopt_int_t of size quadratic_objective_matrix_row_offsets[num_variables] containing
340+ * the column indices of the non-zero elements of the quadratic objective matrix.
341+ * This is part of the compressed sparse row representation of the quadratic objective matrix.
342+ *
343+ * @param[in] quadratic_objective_matrix_coefficent_values - A pointer to an array of type
344+ * cuopt_float_t of size quadratic_objective_matrix_row_offsets[num_variables] containing
345+ * the values of the non-zero elements of the quadratic objective matrix.
346+ *
347+ * @param[in] constraint_matrix_row_offsets - A pointer to an array of type
348+ * cuopt_int_t of size num_constraints + 1. constraint_matrix_row_offsets[i] is the
349+ * index of the first non-zero element of the i-th constraint in
350+ * constraint_matrix_column_indices and constraint_matrix_coefficients.
351+ *
352+ * @param[in] constraint_matrix_column_indices - A pointer to an array of type
353+ * cuopt_int_t of size constraint_matrix_row_offsets[num_constraints] containing
354+ * the column indices of the non-zero elements of the constraint matrix.
355+ *
356+ * @param[in] constraint_matrix_coefficients - A pointer to an array of type
357+ * cuopt_float_t of size constraint_matrix_row_offsets[num_constraints] containing
358+ * the values of the non-zero elements of the constraint matrix.
359+ *
360+ * @param[in] constraint_lower_bounds - A pointer to an array of type
361+ * cuopt_float_t of size num_constraints containing the lower bounds of the constraints.
362+ *
363+ * @param[in] constraint_upper_bounds - A pointer to an array of type
364+ * cuopt_float_t of size num_constraints containing the upper bounds of the constraints.
365+ *
366+ * @param[in] variable_lower_bounds - A pointer to an array of type
367+ * cuopt_float_t of size num_variables containing the lower bounds of the variables.
368+ *
369+ * @param[in] variable_upper_bounds - A pointer to an array of type
370+ * cuopt_float_t of size num_variables containing the upper bounds of the variables.
371+ *
372+ * @param[out] problem_ptr - A pointer to a cuOptOptimizationProblem.
373+ * On output the problem will be created and initialized with the provided data.
374+ *
375+ * @return A status code indicating success or failure.
376+ */
377+ cuopt_int_t cuOptCreateQuadraticRangedProblem (
378+ cuopt_int_t num_constraints ,
379+ cuopt_int_t num_variables ,
380+ cuopt_int_t objective_sense ,
381+ cuopt_float_t objective_offset ,
382+ const cuopt_float_t * objective_coefficients ,
383+ const cuopt_int_t * quadratic_objective_matrix_row_offsets ,
384+ const cuopt_int_t * quadratic_objective_matrix_column_indices ,
385+ const cuopt_float_t * quadratic_objective_matrix_coefficent_values ,
386+ const cuopt_int_t * constraint_matrix_row_offsets ,
387+ const cuopt_int_t * constraint_matrix_column_indices ,
388+ const cuopt_float_t * constraint_matrix_coefficients ,
389+ const cuopt_float_t * constraint_lower_bounds ,
390+ const cuopt_float_t * constraint_upper_bounds ,
391+ const cuopt_float_t * variable_lower_bounds ,
392+ const cuopt_float_t * variable_upper_bounds ,
393+ cuOptOptimizationProblem * problem_ptr );
394+
241395/** @brief Destroy an optimization problem
242396 *
243397 * @param[in, out] problem_ptr - A pointer to a cuOptOptimizationProblem. On
0 commit comments