Let's draw sphere in different ways!
- Loop #1 Devide-n-Conquer
- Python
- C++
- Recursion #1
- Python
- C++
- Loop #2 Geometry
- Python
- C++
- Loop #3 Brute-Force
- Python
- C++
- CUDA
- Loop #4 Brute-Force All
- Python
- C++
- CUDA
- [?] Random Forest Classification
- [?] Failed
- [?] Random Forest Regression
- [?] Failed
- Others
- Python: 0.087s
- C++: 0.682s
- Python: 125834
- C++: 127560
- Iterate Z-axis [0, r], val: c
- Iterate X-axis [r, c], val: a
- Iterate Y-axis [0, a], val: b
- Draw a point (a, b, c) in the red area
- Draw a point (b, a, c) in the green area
- Draw a point (c, b, a) in the blue area
- Iterate 8 octants (+,+,+) to (-,-,-)
- Python: 2.988s
- C++: 14.581s
- Python: 125858
- C++: 127752
- Go over the first octant, find a qualified point (a, b, c)
- Store the point (a, b, c)
- Move the point, one direction at one time
- (a +/- resolution, b, c)
- (a, b +/- resolution, c)
- (a, b, c +/- resolution)
- Iterate 8 octants (+,+,+) to (-,-,-)
Note:
If the terminal complains aboutSegmentation fault (core dumped)
, modifyulimit
in termial with the command below:ulimit -s unlimited
- Python: 0.088s
- C++:
- Python: 125858
- C++:
- Iterate Z-axis [0, r], val: c
- Iterate X-axis [r, c], val: a
- Get the y-axis coordinate is ~= b, val: b
- Draw a point (a, b, c) in the green area
- Draw a point (c, b, a) in the green area
- Iterate 8 octants (+,+,+) to (-,-,-)
- Python:
- C++: 0.506s
- CUDA: 0.490s
- Python:
- C++: 127856
- CUDA: 127840
- Generate 1-D array, length: ((N+1) * (N+1) * (N+1))
- Iterate the array, mark qualified points in the megenta region
- Iterate 8 octants (+,+,+) to (-,-,-)
- Python:
- C++: 0.518s
- CUDA: 0.508s
- Python:
- C++: 125930
- CUDA: 125914
- Generate 1-D array, length: ((2N+1) * (2N+1) * (2N+1))
- Iterate the array, mark qualified points in the yellow region
- Python:
- Python:
- Training on the red dots
- Test