From 4d039b6031d18fae9e06f7a0d526c17632f511ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Sun, 26 Aug 2018 20:28:46 +0000 Subject: [PATCH] =?UTF-8?q?Mal=C3=A1=20illustrace=20effektivity=20=C5=99az?= =?UTF-8?q?en=C3=AD=20r-ek?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Former-commit-id: 12578f504607542b500ce4287cb6341bdb119056 --- tests/lattice/2d_3lat_rcount.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 tests/lattice/2d_3lat_rcount.c diff --git a/tests/lattice/2d_3lat_rcount.c b/tests/lattice/2d_3lat_rcount.c new file mode 100644 index 0000000..e900873 --- /dev/null +++ b/tests/lattice/2d_3lat_rcount.c @@ -0,0 +1,27 @@ +#include +#include +#include + +void dump_points2d_rordered(const points2d_rordered_t *ps, char *filename) { + FILE *f = fopen(filename, "w"); + for (size_t i = 0; i < ps->nrs; ++i) { + fprintf(f, "# r = %.16g\n", ps->rs[i]); + for (ptrdiff_t j = ps->r_offsets[i]; j < ps->r_offsets[i+1]; ++j) + fprintf(f, "%.16g %.16g\n", ps->base[j].x, ps->base[j].y); + } + fclose(f); +} + +int main() { + triangular_lattice_gen_t *g = triangular_lattice_gen_init(1, TRIANGULAR_HORIZONTAL, false,0); + triangular_lattice_gen_extend_to_steps(g, 1000); + for(size_t i = 0; i < g->ps.nrs; ++i) { + printf("%zd %.16g %td\n", i, g->ps.rs[i], g->ps.r_offsets[i+1]); + } + triangular_lattice_gen_free(g); + + return 0; +} + + +