diff scripts/optimization/sqp.m @ 7795:df9519e9990c

Handle single precision eps values
author David Bateman <dbateman@free.fr>
date Mon, 12 May 2008 22:57:11 +0200
parents 32c1c3a3b07c
children d54f113aa983
line wrap: on
line diff
--- a/scripts/optimization/sqp.m
+++ b/scripts/optimization/sqp.m
@@ -281,7 +281,11 @@
 	if (isvector (lb))
 	  __sqp_lb__ = lb;
 	elseif (isempty (lb))
-	  __sqp_lb__ = -realmax;
+	  if (isa (x, "single"))
+	    __sqp_lb__ = -realmax ("single");
+	  else
+	    __sqp_lb__ = -realmax;
+	  endif
 	else
 	  error ("sqp: invalid lower bound");
 	endif
@@ -290,7 +294,11 @@
 	if (isvector (ub))
 	  __sqp_ub__ = ub;
 	elseif (isempty (lb))
-	  __sqp_ub__ = realmax;
+	  if (isa (x, "single"))
+	    __sqp_ub__ = realmax ("single");
+	  else
+	    __sqp_ub__ = realmax;
+	  endif
 	else
 	  error ("sqp: invalid upper bound");
 	endif