|
1 | 1 | """Despace: Spatial Decomposition Without Space Filling Curves |
2 | 2 |
|
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. |
5 | 5 |
|
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. |
8 | 8 |
|
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. |
15 | 15 |
|
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. |
18 | 18 | """ # noqa: E501 |
19 | 19 |
|
20 | 20 | from math import floor |
|
0 commit comments