[SCIP] About program for SOCP with C++

Stefan Vigerske stefan at math.hu-berlin.de
Fri Feb 5 12:54:33 CET 2016


Hi,

I think it just means that you cannot call SCIPgetSolVal with a NULL 
pointer for sol when SCIP has finished solving the problem.
Maybe you were using SCIPgetBestSol() and did not check whether that 
returned NULL (which would indicate that no solution was found).

Stefan

On 02/05/2016 11:44 AM, Satoshi Shirai wrote:
> 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
>>>>>
>>>>
>>>
>>
>


-- 
http://www.gams.com/~stefan


More information about the Scip mailing list