From bf9faf9783020159fe812c8bfefab8382694a3b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Sat, 25 Aug 2018 01:16:50 +0300 Subject: [PATCH] Triangular lattice gen test update Former-commit-id: a38483904bab48ea62c4195a7adb1662f4256565 --- tests/lattice/2d_triangular_lattice.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/tests/lattice/2d_triangular_lattice.c b/tests/lattice/2d_triangular_lattice.c index c7451e1..ee7079d 100644 --- a/tests/lattice/2d_triangular_lattice.c +++ b/tests/lattice/2d_triangular_lattice.c @@ -12,7 +12,7 @@ void dump_points2d_rordered(const points2d_rordered_t *ps, char *filename) { } int main() { - triangular_lattice_gen_t *g = triangular_lattice_gen_init(5, TRIANGULAR_HORIZONTAL, false); + triangular_lattice_gen_t *g = triangular_lattice_gen_init(5, TRIANGULAR_HORIZONTAL, false,0); dump_points2d_rordered(&(g->ps), "triang_h_empty.out"); points2d_rordered_t *p = points2d_rordered_scale(&(g->ps), 1.5464); @@ -21,7 +21,7 @@ int main() { points2d_rordered_free(p); triangular_lattice_gen_free(g); - g = triangular_lattice_gen_init(5, TRIANGULAR_HORIZONTAL, false); + g = triangular_lattice_gen_init(5, TRIANGULAR_HORIZONTAL, false,0); triangular_lattice_gen_extend_to_steps(g, 5); dump_points2d_rordered(&(g->ps), "triang_h_s5.out"); triangular_lattice_gen_extend_to_steps(g, 20); @@ -36,13 +36,21 @@ int main() { triangular_lattice_gen_free(g); - g = triangular_lattice_gen_init(7, TRIANGULAR_VERTICAL, true); + g = triangular_lattice_gen_init(7, TRIANGULAR_VERTICAL, true,1); triangular_lattice_gen_extend_to_steps(g, 7); - dump_points2d_rordered(&(g->ps), "triang_v_s7.out"); + dump_points2d_rordered(&(g->ps), "triang_v_plus_s7.out"); p = points2d_rordered_scale(&(g->ps), 1/7.); triangular_lattice_gen_free(g); - dump_points2d_rordered(p, "triang_v_s7_scaled_out"); + dump_points2d_rordered(p, "triang_v_plus_s7_scaled_out"); points2d_rordered_free(p); + g = triangular_lattice_gen_init(7, TRIANGULAR_VERTICAL, true,-1); + triangular_lattice_gen_extend_to_steps(g, 7); + dump_points2d_rordered(&(g->ps), "triang_v_minus_s7.out"); + p = points2d_rordered_scale(&(g->ps), 1/7.); + triangular_lattice_gen_free(g); + dump_points2d_rordered(p, "triang_v_minus_s7_scaled_out"); + points2d_rordered_free(p); + return 0; }