changeset 5241:ab89f95de831

[project @ 2005-03-24 02:45:30 by jwe]
author jwe
date Thu, 24 Mar 2005 02:45:30 +0000
parents 2bb31f40c339
children 937358a05a18
files scripts/optimization/glpkmex.m src/ChangeLog src/DLD-FUNCTIONS/__glpk__.cc
diffstat 3 files changed, 11 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- 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)
--- 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.
--- 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<double> (lpx_mip_status (lp));
+	  *status = lpx_mip_status (lp);
 	  *fmin = lpx_mip_obj_val (lp);
 	}
       else
 	{
 	  if (lpsolver == 1)
 	    {
-	      *status = static_cast<double> (lpx_get_status (lp));
+	      *status = lpx_get_status (lp);
 	      *fmin = lpx_get_obj_val (lp);
 	    }
 	  else
 	    {
-	      *status = static_cast<double> (lpx_ipt_status (lp));
+	      *status = lpx_ipt_status (lp);
 	      *fmin = lpx_ipt_obj_val (lp);
 	    }
 	}
@@ -343,8 +340,8 @@
 	    }
 	}
 
-      *time = static_cast<double> (clock () - t_start) / CLOCKS_PER_SEC;
-      *mem = static_cast<double> (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<double> (errnum);
+   *status = errnum;
 
    return errnum;
 }