[Swift-commit] r6720 - SwiftTutorials/ATPESC_2013-08-06/part11-swift-py-r

wozniak at ci.uchicago.edu wozniak at ci.uchicago.edu
Fri Aug 2 16:52:42 CDT 2013


Author: wozniak
Date: 2013-08-02 16:52:42 -0500 (Fri, 02 Aug 2013)
New Revision: 6720

Added:
   SwiftTutorials/ATPESC_2013-08-06/part11-swift-py-r/dets.py
Log:
Python reference example


Added: SwiftTutorials/ATPESC_2013-08-06/part11-swift-py-r/dets.py
===================================================================
--- SwiftTutorials/ATPESC_2013-08-06/part11-swift-py-r/dets.py	                        (rev 0)
+++ SwiftTutorials/ATPESC_2013-08-06/part11-swift-py-r/dets.py	2013-08-02 21:52:42 UTC (rev 6720)
@@ -0,0 +1,24 @@
+
+from numpy import *
+
+N = 3
+U = 7
+
+s = repr(eye(3))
+print(eval(s)*2)
+
+dets = zeros(U-1)
+
+for i in range(1,U):
+    A = ones(N)
+    A = A + i*eye(N)
+    A[2,0] = (U-i+1)**3
+    print(A)
+    d = linalg.det(A)
+    print(d)
+    dets[i-1] = abs(d)
+    print
+
+print(dets)
+print(max(dets))
+




More information about the Swift-commit mailing list