mirror of
https://github.com/TheAlgorithms/Python.git
synced 2024-11-23 21:11:08 +00:00
parent
d728f5a96b
commit
b5b1eb2f00
|
@ -1,7 +1,7 @@
|
|||
def get_1s_count(number: int) -> int:
|
||||
"""
|
||||
Count the number of set bits in a 32 bit integer using Brian Kernighan's way.
|
||||
Ref - http://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetKernighan
|
||||
Ref - https://graphics.stanford.edu/~seander/bithacks.html#CountBitsSetKernighan
|
||||
>>> get_1s_count(25)
|
||||
3
|
||||
>>> get_1s_count(37)
|
||||
|
|
|
@ -28,7 +28,6 @@ Usage:
|
|||
Reference:
|
||||
https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/smo-book.pdf
|
||||
https://www.microsoft.com/en-us/research/wp-content/uploads/2016/02/tr-98-14.pdf
|
||||
https://web.cs.iastate.edu/~honavar/smo-svm.pdf
|
||||
"""
|
||||
|
||||
|
||||
|
|
|
@ -8,7 +8,7 @@ velocity and position brought about by these forces. Softening is used to preven
|
|||
numerical divergences when a particle comes too close to another (and the force
|
||||
goes to infinity).
|
||||
(Description adapted from https://en.wikipedia.org/wiki/N-body_simulation )
|
||||
(See also https://www.shodor.org/refdesk/Resources/Algorithms/EulersMethod/ )
|
||||
(See also http://www.shodor.org/refdesk/Resources/Algorithms/EulersMethod/ )
|
||||
"""
|
||||
|
||||
|
||||
|
@ -258,7 +258,7 @@ def example_1() -> BodySystem:
|
|||
Example 1: figure-8 solution to the 3-body-problem
|
||||
This example can be seen as a test of the implementation: given the right
|
||||
initial conditions, the bodies should move in a figure-8.
|
||||
(initial conditions taken from https://www.artcompsci.org/vol_1/v1_web/node56.html)
|
||||
(initial conditions taken from http://www.artcompsci.org/vol_1/v1_web/node56.html)
|
||||
>>> body_system = example_1()
|
||||
>>> len(body_system)
|
||||
3
|
||||
|
|
Loading…
Reference in New Issue
Block a user