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

Attachment: Rglpk.tar.gz
Description: GNU Zip compressed data

_______________________________________________
Help-glpk mailing list
Help-glpk@gnu.org
https://lists.gnu.org/mailman/listinfo/help-glpk

Reply via email to