Originally posted by: SystemAdmin
[tksung said:]
HI!
I am not good in programming , hope this question is not too trivial. Really need some help.
I am trying to retrive the rhs valuse of a presolved LP through
CPXgetredlp and CPXgetrhs.
In the manual
The routine CPXgetredlp returns a pointer for the presolved problem.
I am using function:
CPXPUBLIC CPXgetredlp(CPXCENVptr env, CPXCLPptr lp, CPXCLPptr * redlp_p)
where Parameters:
env: A pointer to the CPLEX environment, as returned by CPXopenCPLEX.
lp: A pointer to a CPLEX LP problem object, as returned by CPXcreateprob.
redlp_p: A pointer to receive the problem object pointer that results when presolve has been applied to the LP problem object.
and The routine CPXgetrhs is used to access the right-hand side coefficients for a range of constraints in a CPLEX problem object.
I am using function:
CPXgetrhs(CPXCENVptr env, CPXCLPptr lp, double * rhs, int begin, int end)
where Parameters:
env: A pointer to the CPLEX environment as returned by CPXopenCPLEX.
lp: A pointer to a CPLEX problem object as returned by CPXcreateprob.
rhs: An array where the specified right-hand side coefficients are to be returned.
-----------------------
My question is
Does "lp" parameter in CPXgetrhs(env, lp, rhs, begin, end) have to be "returned by CPXcreateprob", as mentioned in manual?
Can I use redlp_p, instead of lp, in CPXgetrhs(env, redlp_p, rhs, begin, end) where redlp_p is returned in CPXgetredlp(env, lp, redlp_p)
The redlp_p is "a pointer to receive the problem object pointer that results when presolve has been applied to the LP problem object", not "returned by CPXcreateprob".
I did this in my codes try to get RHS of the presolved problem, but it did not wrok.
Do my codes have bugs? or redlp_p cant be passed to CPXgetrhs as the lp parameter?
Thanks!
#CPLEXOptimizers#DecisionOptimization