On 2014-02-23, Dima Pasechnik <[email protected]> wrote:
> On 2014-02-23, Dima Pasechnik <[email protected]> wrote:
>> On 2014-02-21, Benoît Darties <[email protected]> wrote:
>>> Here is the code I run
>>>
>>> sage: p = MixedIntegerLinearProgram("Coin")
>>> sage: x=p.new_variable(binary=True,dim=1)
>>> sage: p.set_min(x[0], 0.0)
>>> sage: 
>>> sage: result=p.get_values(x);
>>>
>> works for me in Sage 6.1.1 on OSX 10.6.8.
> oops, in fact, this does crash in the latter case, too. 
> (I did get_values() instead of get_values(x)...)
>
> As well as it does crash on Linux x86_64.

the remedy is very simple: Coin's getColSolution() returns NULL 
in this case, and thus 
return solution[variable]
in get_variable_value() produces this crash.
So one has to check for NULL and so something meaningful if it is
NULL, e.g.
       if solution == NULL:
           return [] 
        else:
           return solution[variable]


Not sure whether [] is the right value, perhaps 0 might be more
uniform accross different backends...

>
>
>>
>>
>>
>

-- 
You received this message because you are subscribed to the Google Groups 
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to