[SCIP] About program for SOCP with C++

Satoshi Shirai sshirai at rls.mse.tcu.ac.jp
Fri Feb 5 11:44:04 CET 2016


Dear Stefan, Benny and all,

Thank you for your response.
I was able to debug the error after I changed my program according to instructions.
But when I run my binary with gdb, I got the following error.
Does that mean that the parameter are incorrect set value?

[src/scip/scip.c:403] ERROR: cannot call method <SCIPgetSolVal(sol==NULL)> in problem solved stage
[src/scip/scip.c:34606] ERROR: Error <-8> in function call
test: src/scip/scip.c:34606: SCIPgetSolVal: Assertion `0' failed.


Sincerely,
Satoshi Shirai


On 2016/02/04 23:53, Stefan Vigerske wrote:
 > Hi,
 >
 > this assert tries to tell you that the term on the right-hand-side of your SOC (see http://scip.zib.de/doc/html/cons__soc_8h.php) needs to be non-negative, i.e., x_{n+1} (rhsvar) + beta_{n+1} (rhsoffset) should be >= 0. So you may want to adjust the lower bound on your rhsvar.
 >
 > (I don't remember why we assert this, though. Maybe SCIP could also change the bound on rhsvar during bound tightening.)
 >
 > Stefan
 >
On 2016/02/05 0:15, Benjamin Müller wrote:
> Dear Satoshi,
>
> an easy way to debug your program is to compile SCIP in debug mode (as you have done it) and run your binary with:
>
>        gdb ./bin/test
>
> In gdb you can display all values that you need to consider. It would be worth to search for some gdb tutorials if you are not familiar with it.
>
> When creating the SOC constraint you need to ensure that the right hand side is always non-negative. This will be checked with the two assertions in SCIPcreateConsSOC() which fail in your case.
>
>
> Best regards,
>
> Benny
>
>
> On 02/04/2016 03:34 PM, Satoshi Shirai wrote:
>> Dear all,
>>
>> When I run my program with dbg, I got the following error.
>> What would be a good way to debug it?
>>
>> $ ./bin/test
>> test: src/scip/cons_soc.c:5117: SCIPcreateConsSOC: Assertion `rhsvar == ((void *)0) || rhscoeff <= 0.0 || SCIPisGE(scip, local ? SCIPcomputeVarLbLocal(scip, rhsvar) : SCIPcomputeVarLbGlobal(scip, rhsvar), -rhsoffset)' failed.
>>
>>
>> Sincerely,
>> Satoshi Shirai
>>
>>
>> On 2016/01/29 17:09, Satoshi Shirai wrote:
>>> Dear all,
>>>
>>> I am programming to solve the following problem.
>>> But my program dumps core before SCIPsolve().
>>> It does not make sense.
>>> I use the following functions.
>>>
>>> SCIPcreate()
>>> SCIPincludeDefaultPlugins()
>> > SCIPcreateProbBasic()
>>> SCIPsetObjsense()
>>> SCIPcreateVar()
>>> SCIPaddVar()
>>> SCIPcreateConsLinear()
>>> SCIPaddCoefLinear()
>>> SCIPaddCons()
>>> SCIPcreateConsSOC()
>>> SCIPaddCons()
>>> SCIPsolve()
>>> SCIPgetBestSol()
>>> SCIPprintStatistics()
>>> SCIPgetSolVar()
>>> SCIPreleaseVar()
>>> SCIPreleaseCons()
>>> SCIPfree()
>>>
>>> I have read the documents but I still don't know how to use suitable for the problem.
>>>
>>>
>>> Sincerely,
>>> Shirai
>>>
>>>
>>> On 2015/12/16 16:40, Satoshi Shirai wrote:
>>>> Dear,
>>>>
>>>> I want to solve SOCP.
>>>> But I don't understand how to program to solve it with C++.
>>>>
>>>> maximize     a^T z
>>>> subject to    A1 x + A2 z = t
>>>>         || B x || <= u^T x
>>>>
>>>> where
>>>>
>>>> a, z \in R^2
>>>> x, u \in R^9
>>>> A1 \in R^{6*9}
>>>> A2 \in R^{6*2}
>>>> B  \in R^{9*9}
>>>>
>>>>
>>>> I think to use the following function mainly, right?
>>>> I have read the documents
>>>> but I still don't know how to use suitable for the problem.
>>>>
>>>> SCIPcreateVar()
>>>> SCIPcreateConsLinear()
>>>> SCIPcreateConsSOC()
>>>>
>>>>
>>>> Regards,
>>>> Shirai
>>>>
>>>
>>
>

-- 
----------------------------------------------------
Satoshi Shirai
Robotic Life Support Laboratory,
Department of Mechanical Systems Engineering,
Faculty of Engineering,
Tokyo City University
Tamazutsumi 1-28-1, Setagaya, Tokyo 158-8557, Japan
E-mail: sshirai at rls.mse.tcu.ac.jp
----------------------------------------------------


More information about the Scip mailing list