[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-glpk] Error handling in Rglpk
From: |
Heinrich Schuchardt |
Subject: |
Re: [Help-glpk] Error handling in Rglpk |
Date: |
Fri, 3 Jul 2015 04:14:27 +0200 |
Hello Stefan,
thank you for the new release.
I just checked the code in the distribution tar ball and subversion.
You updated Rglpk_solve.c. Please, consider error handling in
Rglpk_read_file.c, too.
cf.
https://r-forge.r-project.org/scm/viewvc.php/pkg/Rglpk/src/Rglpk_read_file.c?root=rglp&view=log
https://lists.gnu.org/archive/html/help-glpk/2015-02/msg00004.html
Best regards
Heinrich Schuchardt
> Gesendet: Donnerstag, 02. Juli 2015 um 20:29 Uhr
> Von: "Stefan Theussl" <address@hidden>
> An: "Heinrich Schuchardt" <address@hidden>
> Cc: address@hidden, "GLPK help" <address@hidden>
> Betreff: Re: Error handling in Rglpk
>
> Hello Heinrich,
>
> thank you for providing us with this patch. It has been some time but I
> finally managed to make the changes to the package and uploaded a new
> Version to CRAN.
>
> Cheers,
> Stefan
>
> On 2015-02-17 19:49, Heinrich Schuchardt wrote:
> > Hello Stefan,
> >
> > currently Rglpk will cause the R process to be terminated if an error
> > occurs in the GLPK library.
> >
> > You can use the following GMPL file (test.mod) for testing:
> >
> > var x, >=0;
> > minimize obj : x + 5;
> > end;
> >
> > Now start R and
> >
> > library(Rglpk)
> > x <- Rglpk_read_file( "/home/user/test.mod", type = "MathProg", verbose
> > = TRUE)
> > Rglpk_solve_LP(x$objective, x$constraints[[1]], x$constraints[[2]],
> > x$constraints[[3]], x$bounds, x$types, x$maximum)
> >
> > The GLPK library detects that the problem has no constraint and
> > terminates the R process.
> >
> > I have patched the sources such that an error is correctly handled.
> > See appendix.
> >
> > Rglpk_solve and Rglpk_read_file call
> > glp_error_hook(Rglpk_error_hook, &env);
> >
> > This sets the hook function to Rglpk_error_hook.
> >
> > A far jump is used to return if an error occurs.
> >
> > Best regards
> >
> > Heinrich Schuchardt
> >
>
>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- Re: [Help-glpk] Error handling in Rglpk,
Heinrich Schuchardt <=