How to get access to the coefficient matrix in a QCQP model that already been built in the C++ API?
Hi Everyone,
I am solving a Quadratic Programming Problem with Quadratic Constraints (QCQP) with CPLEX using C++ API. Currently, I am struggling with getting access to the coefficient matrix in a model that has already been built. The objective function of the model is quadratic, and the constraints include Second-order cone programming (SOCP) constraints, Quadratic constraints, and linear constraints.
And I have the following ideas:
1) Use IloModel::Iterator to traverse the variables, constraints, and objectives in the model.
2) Use IloExtractable to judge their types.
I wonder if this idea is correct, and can anyone provide a piece of C + + code for reference?
Thanks in advance!
------------------------------
Musheng Li
------------------------------
Original Message:
Sent: Wed January 05, 2022 02:46 AM
From: Archive User
Subject: How to get access to the coefficients in the LP model
Originally posted by: GP_Song
Hi Everyone,
I am doing branch-and-price with CPLEX using C++ API, currently I am struggling with getting access to the columns already generated. The only way I found is to use IloExpr::LinearIterator.getCoef(), which needs to extract each constraint as expression thus seems not efficient nor convenient. Or the other way is to duplicate all the columns generated into another matrix. I was wondering if there is any function defined for direct accessing the coefficients in the LP model, especially the column-wise built model.
Thanks in advance!
#DecisionOptimization