# HG changeset patch # User jwe # Date 1111632330 0 # Node ID ab89f95de831f23612a6d968d2eaa62fad3d0046 # Parent 2bb31f40c33903d3f04ac20df3cd7efb26eb7edd [project @ 2005-03-24 02:45:30 by jwe] diff -r 2bb31f40c339 -r ab89f95de831 scripts/optimization/glpkmex.m --- a/scripts/optimization/glpkmex.m Thu Mar 24 02:34:13 2005 +0000 +++ b/scripts/optimization/glpkmex.m Thu Mar 24 02:45:30 2005 +0000 @@ -88,7 +88,7 @@ endif if (nargin > 10 && ! isfield (param, "save")) - param.lpsolver = varargin{11}; + param.save = varargin{11}; endif if (nargout == 0) diff -r 2bb31f40c339 -r ab89f95de831 src/ChangeLog --- a/src/ChangeLog Thu Mar 24 02:34:13 2005 +0000 +++ b/src/ChangeLog Thu Mar 24 02:45:30 2005 +0000 @@ -7,6 +7,8 @@ (glpk_fault_hook): Call message instead of writing to octave_stderr. (glpk_fault_hook): Call error instead of writing to octave_stderr. (glpk): Likewise. + Declare mark static. Delete declaration of fperr. + (glpk): Delete unnecessary casts. * DLD-FUNCTIONS/__glpk__.cc (OCTAVE_GLPK_GET_REAL_PARAM, OCTAVE_GLPK_GET_INT_PARAM): New macros. diff -r 2bb31f40c339 -r ab89f95de831 src/DLD-FUNCTIONS/__glpk__.cc --- a/src/DLD-FUNCTIONS/__glpk__.cc Thu Mar 24 02:34:13 2005 +0000 +++ b/src/DLD-FUNCTIONS/__glpk__.cc Thu Mar 24 02:45:30 2005 +0000 @@ -111,9 +111,7 @@ LPX_K_TOLOBJ }; -jmp_buf mark; //-- Address for long jump to jump to -int fperr; //-- Global error number - +static jmp_buf mark; //-- Address for long jump to jump to int glpk_fault_hook (void * /* info */, char *msg) @@ -125,11 +123,10 @@ int glpk_print_hook (void * /* info */, char *msg) { - message (0, "%s\n", msg); + message (0, "%s", msg); return 1; } - int glpk (int sense, int n, int m, double *c, int nz, int *rn, int *cn, double *a, double *b, char *ctype, int *freeLB, double *lb, @@ -291,19 +288,19 @@ { if (isMIP) { - *status = static_cast (lpx_mip_status (lp)); + *status = lpx_mip_status (lp); *fmin = lpx_mip_obj_val (lp); } else { if (lpsolver == 1) { - *status = static_cast (lpx_get_status (lp)); + *status = lpx_get_status (lp); *fmin = lpx_get_obj_val (lp); } else { - *status = static_cast (lpx_ipt_status (lp)); + *status = lpx_ipt_status (lp); *fmin = lpx_ipt_obj_val (lp); } } @@ -343,8 +340,8 @@ } } - *time = static_cast (clock () - t_start) / CLOCKS_PER_SEC; - *mem = static_cast (lib_env_ptr () -> mem_tpeak); + *time = (clock () - t_start) / CLOCKS_PER_SEC; + *mem = (lib_env_ptr () -> mem_tpeak); lpx_delete_prob (lp); return 0; @@ -352,7 +349,7 @@ lpx_delete_prob (lp); - *status= static_cast (errnum); + *status = errnum; return errnum; }