help-glpk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-glpk] How to return the best MIP solution when the branch & cu


From: glpk xypron
Subject: Re: [Help-glpk] How to return the best MIP solution when the branch & cut tree is exceeds memory limit (API implementation)
Date: Tue, 10 Jan 2012 23:23:28 +0100

Hello Ruben,

> error: no match for "operator >=" in "total >= 32212254721"
You are trying to compare an integer with a structure.

In glpk.h you will find:
typedef struct { int lo, hi; } glp_long;

To convert the structure to a double value you could use:
z = 4294967296.0 * (double)x.hi + (double)(unsigned int)x.lo;
(see function xltod in glplib02.c)

>     { if((glp_ios_mip_gap(tree)<=0.05)||(total >= 3221225472))
Please, replace this line by
     { if (
        glp_ios_mip_gap(tree)<=0.05
     || total.hi > 0
     || total.lo >= 3221225472) // 3GB

Best regards

Xypron


-------- Original-Nachricht --------
> Datum: Mon, 9 Jan 2012 12:00:16 -0500
> Betreff: Re: [Help-glpk] How to return the best MIP solution when the branch 
> & cut tree is exceeds memory limit (API implementation)

> Xypron,
> 
> Thank you very much for the message you sent to me on Dec 28. I have been
> having trouble with the error_hook function, so I did modify my callback
> function as follows:
> 
> 
> void cb_func(glp_tree *tree, void *info)
> {
>     glp_long total;
>     glp_mem_usage(NULL,NULL,&total,NULL);
>     if(glp_ios_reason(tree)==GLP_IBINGO)
>     { if((glp_ios_mip_gap(tree)<=0.05)||(total >= 3221225472))
>        {
>         glp_ios_terminate(tree);
>        }
>     }
>     return;
> }
> 
> I think the function should work know. However, when compiling my
> application in g++ over unix I get a message indicating " error: no match
> for "operator >=" in "total >= 32212254721".
> 
> I really do not understand why this error is happening. I would appreciate
> any hint.
> 
> Best regards,
> 
> Ruben
> 

-- 
Follow me at http://twitter.com/#!/xypron

Empfehlen Sie GMX DSL Ihren Freunden und Bekannten und wir
belohnen Sie mit bis zu 50,- Euro! https://freundschaftswerbung.gmx.de



reply via email to

[Prev in Thread] Current Thread [Next in Thread]