dimension-reduction

Find neighbours outside of 2d grid which is reduced into a 1d array

♀尐吖头ヾ 提交于 2019-12-08 13:55:53
问题 I have a two dimensional grid where width and height are always the same. [0][1][2] [3][4][5] [6][7][8] I reduced it's data source into a one-dimensional array. [0][1][2][3][4][5][6][7][8] Access of elements works, but here comes the tricky part: How to know, whether a neighbour of a cell is outside the grid when still processing the one-dimensional array? For example the upper right neighbour of [5] is out of the grid but using a calculcated offset index, I will get [3]. Anyone with

Mapping N-dimensional value to a point on Hilbert curve

痞子三分冷 提交于 2019-11-26 17:04:40
I have a huge set of N-dimensional points (tens of millions; N is close to 100). I need to map these points to a single dimension while preserving spatial locality. I want to use Hilbert space-filling curve to do it. For each point I want to pick the closest point on the curve. The Hilbert value of the point (curve length from the start of curve to the picked point) is the single dimension value I seek. Computation does not have to be instant, but I expect it to be no more than several hours on decent modern home PC hardware. Any suggestions on implementation? Are there any libraries that

Mapping N-dimensional value to a point on Hilbert curve

隐身守侯 提交于 2019-11-26 05:15:53
问题 I have a huge set of N-dimensional points (tens of millions; N is close to 100). I need to map these points to a single dimension while preserving spatial locality. I want to use Hilbert space-filling curve to do it. For each point I want to pick the closest point on the curve. The Hilbert value of the point (curve length from the start of curve to the picked point) is the single dimension value I seek. Computation does not have to be instant, but I expect it to be no more than several hours