Skip to content

Commit 04f00a4

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent d56b4e0 commit 04f00a4

File tree

1 file changed

+12
-12
lines changed

1 file changed

+12
-12
lines changed

despace/spatial_sort.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,20 @@
11
"""Despace: Spatial Decomposition Without Space Filling Curves
22
3-
`Despace` is a tool to sort n dimensional data in a spatial decomposition way.
4-
Instead of using space filling curves, we use a simple sorting scheme.
3+
`Despace` is a tool to sort n dimensional data in a spatial decomposition way.
4+
Instead of using space filling curves, we use a simple sorting scheme.
55
6-
For the n=1 case, it's just a single sort.
7-
For the n>=2 dimensional cases, it's possible to index 'coordinates' so that proximal points are stored closely.
6+
For the n=1 case, it's just a single sort.
7+
For the n>=2 dimensional cases, it's possible to index 'coordinates' so that proximal points are stored closely.
88
9-
We do it in the following way:
10-
1) Sort the the n-D coordinates by the first dimension;
11-
2) Divide the coordinates into two;
12-
3) For each half, sort the coordinates by the second dimension;
13-
4) For each sorted half, divide the coordinates into two, and for each half in halves, sort by the next dimension, and so on;
14-
5) Repeat by circularly rotating the dimension indices until divided to individual elements.
9+
We do it in the following way:
10+
1) Sort the the n-D coordinates by the first dimension;
11+
2) Divide the coordinates into two;
12+
3) For each half, sort the coordinates by the second dimension;
13+
4) For each sorted half, divide the coordinates into two, and for each half in halves, sort by the next dimension, and so on;
14+
5) Repeat by circularly rotating the dimension indices until divided to individual elements.
1515
16-
The sorted (re-indexed) N-D array can be useful in geological and N-body simulations like in molecular dynamics
17-
and astronomical physics.
16+
The sorted (re-indexed) N-D array can be useful in geological and N-body simulations like in molecular dynamics
17+
and astronomical physics.
1818
""" # noqa: E501
1919

2020
from math import floor

0 commit comments

Comments
 (0)