[SCIP] Dual value of constraints

Gerald Gamrath gamrath at zib.de
Sat Mar 24 14:16:43 CET 2018


Dear Mahdi,

these are really standard C++ errors, because the methods you are using 
are not found (or not found for the respective parameter types).

For SCIPgetDualSolVal, this might be related to the fact that you are 
using SCIP 3.2.0, but the method was only introduced in SCIP 4.0.1.

For the second one, I can only guess, but it looks like part_con[0][1] 
is not a SCIP_CONS*. But if you managed to write your own extension of 
SCIP, I am sure you will be able to fix such basic C++ issues without 
the help of the SCIP mailing list.

Best,
Gerald

On 24.03.2018 13:20, Mahdi Noorizadegan wrote:
> Hi Marco and Gerald,
>
> I am sure that the reduced cost is zero, however, one of the reviewers 
> of our paper has asked us to compute the reduced cost of basic 
> variables to
> prove the correctness of our method.
>
> Below is the error.
> Regards,
> Mahdi
>
> *src/main_single-StageVRP_CCP.cpp:1039:19: **error: **use of 
> undeclared identifier 'SCIPgetDualSolVal'; did you mean 'SCIPsetSolVal'?*
> SCIP_CALL(SCIPgetDualSolVal(scip,part_con[0][1],dualval,checkbool ));
> *^~~~~~~~~~~~~~~~~*
> SCIPsetSolVal
> *../../src/scip/def.h:266:44: **note: *expanded from macro 'SCIP_CALL'
>                         if( (_restat_ = (x)) != SCIP_OKAY )           
>                                       \
> *                        ^*
> *../../src/scip/scip.h:16090:14: **note: *'SCIPsetSolVal' declared here
> SCIP_RETCODE SCIPsetSolVal(
> *             ^*
> *src/main_single-StageVRP_CCP.cpp:1039:42: **error: **no viable 
> conversion from 'SCIP_Cons' to 'SCIP_SOL *' (aka 'SCIP_Sol *')*
> SCIP_CALL(SCIPgetDualSolVal(scip,part_con[0][1],dualval,checkbool ));
> *                      ^~~~~~~~~~~~~~*
> *../../src/scip/def.h:266:44: **note: *expanded from macro 'SCIP_CALL'
>                         if( (_restat_ = (x)) != SCIP_OKAY )           
>                                       \
> *                        ^*
> *../../src/scip/scip.h:16092:26: **note: *passing argument to 
> parameter 'sol' here
> SCIP_SOL*             sol,                /**< primal solution */
> *      ^*
> *src/main_single-StageVRP_CCP.cpp:1040:16: **error: **no matching 
> function for call to 'SCIPgetDualsolLinear'*
>       cout<< SCIPgetDualsolLinear(scip, part_con[0][1]);
> *^~~~~~~~~~~~~~~~~~~~*
> *
> *
>> On 24 Mar 2018, at 3:02 pm, Marco Lübbecke 
>> <marco.luebbecke at rwth-aachen.de 
>> <mailto:marco.luebbecke at rwth-aachen.de>> wrote:
>>
>> Mahdi, basic variables have reduced cost of zero in an optimal 
>> solution. -- Marco
>>
>> Mahdi Noorizadegan <m.noorizadegan at gmail.com 
>> <mailto:m.noorizadegan at gmail.com>> schrieb am Sa., 24. März 2018, 11:10:
>>
>>     Dear SCIPers,
>>
>>     I need to compute the reduced cost of basic variables in the
>>     optimal solution.
>>     How can I do it?
>>     I tried to use SCIPgetDualsolLinear and SCIPgetDualSolVal .
>>     as follows
>>     SCIP_CALL(SCIPgetDualSolVal(scip,part_con[0][1],dualval,checkbool ));
>>     or cout<< SCIPgetDualsolLinear(scip, part_con[0][1]);
>>     But it did not work and I got errors.
>>
>>     Looking forward to haring from you,
>>     Regards,
>>     Mahdi
>>     _______________________________________________
>>     Scip mailing list
>>     Scip at zib.de <mailto:Scip at zib.de>
>>     https://listserv.zib.de/mailman/listinfo/scip
>>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listserv.zib.de/pipermail/scip/attachments/20180324/e36f81fc/attachment.html>


More information about the Scip mailing list