[Scip] Fwd: Re: problem while adding a separator

Stefan Heinz heinz at zib.de
Mon Oct 15 22:21:41 MEST 2012



Hi Ahmad,

If you are using the C++ wrapper classes, the "SepaData" is not usable
for you. The SepaData is used to sort the C++ class and some othe SCIP
internal stuff. In case of a C++ wrapper class, all your objects have to
be members of the C++ class. If you check the VRP example, the pricer
pricer_vrp.cpp is a C++ variable pricer and all the data that pricer
needs are member of the C++ class.

Does that clear the issue a little bit?

On 10/15/2012 02:41 PM, Ahmad Moradi wrote:
> Hi,
>
> yes its solved, however I had to change both SepaData structure in
> ObjSepa.cpp and the one in my separator and make them exactly similar.
> Other than that I will receive segmentation faults.
This is basically a dirty hack. Since both structures are the same it
works. As I said you need to move your data objects to the C++ class.
>
> (probably i will receive error will adding any internal scip separator,
> however at the moment i dont use them)
It works since the internal separators are written in C. If will fail if
a second C++ separator is added (except if the sepadata is the same ;-)).
>
> Stefan, my separator works with cplex. actually it imports a list of cuts
> by calling a code who uses cplex. now I found that variable indexing in
> cplex is different from what scip will use. In fact, I dont know how to
> translate cuts from cplex (on the same lp) to cuts valid for scip.
>
> to explain more, I will pass the lp in transformed form scip to some inner
> code. the code will return a list of cuts generated by cplex. the list
> contains variable index and coefficients lists. the question exactly comes
> in this part. I don’t know exactly how translate cuts from cplex to cuts
> valid in scip environment.
Well you need a map which tells you which SCIP variable belongs to which
CPLEX variable. In the moment when you create the CPLEX variable for a
SCIP variable you add that mapping. Later when you want to copy the
CPLEX cuts to SCIP you use that map for converting them. SCIP has a
HashMap available.
See  http://scip.zib.de/doc/html/group__HashMap.shtml. Or since you use
C++ just use the std hashmap.

Best Stefan

>
> thanks in advance and looking forward to hearing from you,
> Ahmad
>
> On Mon, Oct 15, 2012 at 2:14 PM, Stefan Heinz <heinz at zib.de> wrote:
>
>> Hi,
>>
>> is the problem solved yet?
>>
>> Stefan
>>
>>
>>
>> On 10/10/12 16:26, Ahmad Moradi wrote:
>>
>>> Hi Stefan,
>>>
>>> I am trying to add a separator which is very similar to gomory. As I am
>>> writing the code in c++, I used the wrapper class ObjSepa and the method
>>> SCIPincludeObjSepa() to include it in scip. I am not sure, But I think this
>>> way, the class SepaData sent by SCIPincludeObjSepa() is actually the one
>>> defined in ObjSepa.cpp not the one defined in sepa_gomory.c. SCIP will say
>>> nothing during the make process, However during the run process I will
>>> receive segmentation fault errors.
>>>
>>> Could you please let help me find what is the problem and how to fix it
>>> Thanks in advance,
>>> Ahmad
>>>
>>






More information about the Scip mailing list