简体   繁体   中英

How to get the values of the coefficients in the constraint matrix of an MILP in SCIP C++ interface

I am trying to get the coefficients of a variable in the constraint matrix of an MILP in SCIP. What I had been thinking was to loop through all the constraints that the variables appear in and somehow get the coefficients ( I am not sure how to). But is there a way to get all the coefficients in an std::vector by using any inbuilt functions.

What type of constraints do you have? If all your constraints are linear, you can include cons_linear.h , loop through all constraints and call SCIPconsGetVars and SCIPconsGetVals . This gives you all the variables that appear in your current constraint, as well as the coefficients.

What is it exactly that you want to do with these coefficients?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM