[Swift-commit] r7765 - SwiftApps/SimulatedAnnealing

wilde at ci.uchicago.edu wilde at ci.uchicago.edu
Fri Apr 11 16:48:01 CDT 2014


Author: wilde
Date: 2014-04-11 16:48:01 -0500 (Fri, 11 Apr 2014)
New Revision: 7765

Modified:
   SwiftApps/SimulatedAnnealing/sa.swift
Log:
sa edit

Modified: SwiftApps/SimulatedAnnealing/sa.swift
===================================================================
--- SwiftApps/SimulatedAnnealing/sa.swift	2014-04-11 21:43:06 UTC (rev 7764)
+++ SwiftApps/SimulatedAnnealing/sa.swift	2014-04-11 21:48:01 UTC (rev 7765)
@@ -378,9 +378,10 @@
   y[0] = objective(a[0]);
 
   iterate c {
-    float na[] = [ newx(a[0],0.5), newx(a[1],0.5), newx(a[2],0.5), newx(a[3],0.5) ];
-    float ny = objective(na);
-    trace(c,ny);
+    int cy = c + 1;
+    float na[] = [ newx(a[0][0],0.5), newx(a[0][1],0.5), newx(a[0][2],0.5), newx(a[0][3],0.5) ];
+    y[cy] = objective(na);
+    trace(c,y[c]);
   } until (c==10);
 
 }




More information about the Swift-commit mailing list