Tag: 希尔伯特曲线

如何调用Hilbert曲线编码C例程

我试图运行用C编写的Hilbert曲线代码,我在这里找到了http://www.tddft.org/svn/octopus/trunk/src/grid/hilbert.c 代码运行,但我从输出中得到的结果不正确。 我做了一个简单的驱动程序例程,它从命令行获取3个值作为参数,并将它们传递给Hilbert曲线编码,解码例程。 更确切地说,我无法解码原始坐标(x,y,z)。 我的一个问题是了解变量nbits正在做什么。 我假设它是编码的希尔伯特值的大小。 为了检查这一点,我试图修改其中一个函数的原始定义 void InttoTranspose(const int dim, const long long int h, int * x) 至 void InttoTranspose(const int dim, const long long int h, int * x, int* size) 我为*size指定位数变量ifbit。 无论如何,这一切都行不通。 因此,我想请求你的帮助。 修改后的代码在这里: #include //#include #include /* This code is based on the implementation of the Hilbert curves presented in: […]