chiark / gitweb /
Use trusty
[nlopt.git] / cdirect / cdirect.c
index d37e8913e73e37fa1bba20d731635420368bd0fe..165f8e8dff24dcf20596ee70828549dd7a428023 100644 (file)
@@ -1,4 +1,4 @@
-/* Copyright (c) 2007-2010 Massachusetts Institute of Technology
+/* Copyright (c) 2007-2014 Massachusetts Institute of Technology
  *
  * Permission is hereby granted, free of charge, to any person obtaining
  * a copy of this software and associated documentation files (the
@@ -414,7 +414,7 @@ static nlopt_result divide_good_rects(params *p)
          if (im >= 0)
               K1 = (hull[i][1] - hull[im][1]) / (hull[i][0] - hull[im][0]);
          if (ip < nhull)
-              K1 = (hull[i][1] - hull[ip][1]) / (hull[i][0] - hull[ip][0]);
+              K2 = (hull[i][1] - hull[ip][1]) / (hull[i][0] - hull[ip][0]);
          K = MAX(K1, K2);
          if (hull[i][1] - K * hull[i][0]
              <= p->minf - magic_eps * fabs(p->minf) || ip == nhull) {