/* Copyright (C) 2018 David Robillard This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program. If not, see . */ #include "chilbert/chilbert.hpp" #include #include #include #include #include int main(int argc, char** argv) { if (argc != 2) { fprintf(stderr, "Usage: %s NUM_POINTS\n", argv[0]); return 1; } const unsigned long num_points = std::strtoul(argv[1], nullptr, 10); if (num_points == 0 || num_points == ULONG_MAX) { fprintf(stderr, "Usage: %s NUM_POINTS\n", argv[0]); return 1; } const uint32_t w = uint32_t(sqrt(1 << uint32_t(ceil(log2(double(num_points)))))) - 1; // Header printf("\n", w, w); printf("Hilbert Curve\n"); printf("\n\n"); return 0; }