File tree 3 files changed +33
-1
lines changed
playtime/Python/curse-of-dim
3 files changed +33
-1
lines changed Original file line number Diff line number Diff line change
1
+ #!/usr/bin/python
2
+
3
+ import math
4
+
5
+ R = 1
6
+ STEP_SIZE = .05
7
+ print 'R, "% VOLUME"'
8
+ print "******"
9
+
10
+ TOTAL_AREA = math .pi * R ** 2
11
+ NSTEPS = int (R / STEP_SIZE )
12
+ for i in range (1 , NSTEPS + 1 ):
13
+ r = i * STEP_SIZE
14
+ area = math .pi * r ** 2
15
+ print r , area / TOTAL_AREA
16
+
17
+ print "******"
18
+
19
+ TOTAL_VOLUME = 4.0 / 3.0 * math .pi * R ** 3
20
+ for i in range (1 , NSTEPS + 1 ):
21
+ r = i * STEP_SIZE
22
+ vol = 4.0 / 3.0 * math .pi * r ** 3
23
+ print r , vol / TOTAL_VOLUME
24
+
25
+
26
+
27
+
28
+
29
+
30
+
31
+
32
+
Original file line number Diff line number Diff line change 1
- The code in this directory is written about at:
1
+ The code in this directory is written about at: http://wp.me/p1Pqiu-9X
2
2
3
3
The basic idea is that CUDA under OS X is only supported with g++, and in fact clang++ will
4
4
choke due to a number of reasons, one of which is support for certain atomic instructions, the
You can’t perform that action at this time.
0 commit comments