diff scripts/optimization/sqp.m @ 17174:c3c1ebfaa7dc

maint: Use common indentation for switch statement. * scripts/general/interp1.m, scripts/geometry/delaunay.m, scripts/help/__unimplemented__.m, scripts/image/cmunique.m, scripts/miscellaneous/edit.m, scripts/optimization/fzero.m, scripts/optimization/sqp.m, scripts/plot/__gnuplot_drawnow__.m, scripts/plot/hidden.m, scripts/plot/legend.m, scripts/plot/print.m, scripts/plot/printd.m, scripts/plot/private/__contour__.m, scripts/plot/private/__fltk_print__.m, scripts/plot/private/__gnuplot_print__.m, scripts/plot/private/__go_draw_axes__.m, scripts/plot/private/__print_parse_opts__.m, scripts/signal/periodogram.m, scripts/sparse/bicg.m, test/slice.tst, test/switch.tst: Use common indentation for switch statement.
author Rik <rik@octave.org>
date Sun, 04 Aug 2013 15:11:34 -0700
parents e39f00a32dc7
children 7babcdb9bc13
line wrap: on
line diff
--- a/scripts/optimization/sqp.m	Sun Aug 04 17:27:40 2013 -0400
+++ b/scripts/optimization/sqp.m	Sun Aug 04 15:11:34 2013 -0700
@@ -203,19 +203,19 @@
   have_hess = 0;
   if (iscell (objf))
     switch (numel (objf))
-     case 1
-       obj_fun = objf{1};
-       obj_grd = @ (x) fd_obj_grd (x, obj_fun);
-     case 2
-       obj_fun = objf{1};
-       obj_grd = objf{2};
-     case 3
-       obj_fun = objf{1};
-       obj_grd = objf{2};
-       obj_hess = objf{3};
-       have_hess = 1;
-     otherwise
-      error ("sqp: invalid objective function specification");
+      case 1
+        obj_fun = objf{1};
+        obj_grd = @ (x) fd_obj_grd (x, obj_fun);
+      case 2
+        obj_fun = objf{1};
+        obj_grd = objf{2};
+      case 3
+        obj_fun = objf{1};
+        obj_grd = objf{2};
+        obj_hess = objf{3};
+        have_hess = 1;
+      otherwise
+        error ("sqp: invalid objective function specification");
     endswitch
   else
     obj_fun = objf;   # No cell array, only obj_fun set
@@ -227,14 +227,14 @@
   if (nargin > 2)
     if (iscell (cef))
       switch (numel (cef))
-       case 1
-         ce_fun = cef{1};
-         ce_grd = @ (x) fd_ce_jac (x, ce_fun);
-       case 2
-         ce_fun = cef{1};
-         ce_grd = cef{2};
-       otherwise
-         error ("sqp: invalid equality constraint function specification");
+        case 1
+          ce_fun = cef{1};
+          ce_grd = @ (x) fd_ce_jac (x, ce_fun);
+        case 2
+          ce_fun = cef{1};
+          ce_grd = cef{2};
+        otherwise
+          error ("sqp: invalid equality constraint function specification");
       endswitch
     elseif (! isempty (cef))
       ce_fun = cef;   # No cell array, only constraint equality function set
@@ -262,13 +262,13 @@
       ci_grd = @ (x) fd_ci_jac (x, globals.cifcn);
       if (iscell (cif))
         switch (length (cif))
-         case {1}
-           ci_fun = cif{1};
-         case {2}
-           ci_fun = cif{1};
-           ci_grd = cif{2};
-        otherwise
-          error ("sqp: invalid inequality constraint function specification");
+          case 1
+            ci_fun = cif{1};
+          case 2
+            ci_fun = cif{1};
+            ci_grd = cif{2};
+          otherwise
+           error ("sqp: invalid inequality constraint function specification");
         endswitch
       elseif (! isempty (cif))
         ci_fun = cif;   # No cell array, only constraint inequality function set