File tree 3 files changed +3
-4
lines changed
3 files changed +3
-4
lines changed Original file line number Diff line number Diff line change 1
1
def get_1s_count (number : int ) -> int :
2
2
"""
3
3
Count the number of set bits in a 32 bit integer using Brian Kernighan's way.
4
- Ref - http ://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetKernighan
4
+ Ref - https ://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetKernighan
5
5
>>> get_1s_count(25)
6
6
3
7
7
>>> get_1s_count(37)
Original file line number Diff line number Diff line change 28
28
Reference:
29
29
https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/smo-book.pdf
30
30
https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/tr-98-14.pdf
31
- https://web.cs.iastate.edu/~honavar/smo-svm.pdf
32
31
"""
33
32
34
33
Original file line number Diff line number Diff line change 8
8
numerical divergences when a particle comes too close to another (and the force
9
9
goes to infinity).
10
10
(Description adapted from https://en.wikipedia.org/wiki/N-body_simulation )
11
- (See also https ://www.shodor.org/refdesk/Resources/Algorithms/EulersMethod/ )
11
+ (See also http ://www.shodor.org/refdesk/Resources/Algorithms/EulersMethod/ )
12
12
"""
13
13
14
14
@@ -258,7 +258,7 @@ def example_1() -> BodySystem:
258
258
Example 1: figure-8 solution to the 3-body-problem
259
259
This example can be seen as a test of the implementation: given the right
260
260
initial conditions, the bodies should move in a figure-8.
261
- (initial conditions taken from https ://www.artcompsci.org/vol_1/v1_web/node56.html)
261
+ (initial conditions taken from http ://www.artcompsci.org/vol_1/v1_web/node56.html)
262
262
>>> body_system = example_1()
263
263
>>> len(body_system)
264
264
3
You can’t perform that action at this time.
0 commit comments