Hi,

I found a strange behaviour of glpk library.
The glp_write_lp function aborts the entire program
when problem to write is empty.
I don't think it is a desired behaviour (especially when problems
are generated from dynamic data)
In my opinion, this function should instead return an
error code when such a situation happens.
I have joined a simple sample program that illustrates
the problem.

Regards

Sйbastien

/* sample.c */

#include <stdio.h>
#include <stdlib.h>
#include <glpk.h>

int main(void)
{ 
  glp_prob *lp;
  lp = glp_create_prob();
  /* the program aborts during the function call */
  /* it should instead return an error code */
  int ret = glp_write_lp(lp, NULL, "problem");
  glp_delete_prob(lp);
  return 0;
}

/* eof */
_______________________________________________
Bug-glpk mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/bug-glpk

Reply via email to