From 4674fa58441b388298466b7d5ffb1de225389ec6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Thu, 16 Jan 2020 10:01:06 +0200 Subject: [PATCH] fix qpms_tmatrix_copy and pointer for comparison Former-commit-id: 98d91011109689512ccda2f8aab593909d0555e0 --- qpms/scatsystem.c | 2 +- qpms/tmatrices.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/qpms/scatsystem.c b/qpms/scatsystem.c index 805c5ea..2d48fd7 100644 --- a/qpms/scatsystem.c +++ b/qpms/scatsystem.c @@ -224,7 +224,7 @@ qpms_scatsys_at_omega_t *qpms_scatsys_apply_symmetry(const qpms_scatsys_t *orig, qpms_tmatrix_t *ti = qpms_tmatrix_apply_operation(&(orig->tm[i].op), tm_orig_omega[orig->tm[i].tmgi]); qpms_ss_tmi_t j; for (j = 0; j < ss->tm_count; ++j) - if (qpms_tmatrix_isclose(ssw->tm[i], ssw->tm[j], tol->rtol, tol->atol)) { + if (qpms_tmatrix_isclose(ti, ssw->tm[j], tol->rtol, tol->atol)) { break; } if (j == ss->tm_count) { // duplicity not found, save both the "abstract" and "at omega" T-matrices diff --git a/qpms/tmatrices.c b/qpms/tmatrices.c index c60f146..25146cc 100644 --- a/qpms/tmatrices.c +++ b/qpms/tmatrices.c @@ -66,7 +66,7 @@ qpms_tmatrix_t *qpms_tmatrix_copy(const qpms_tmatrix_t *T) { qpms_tmatrix_t *t = qpms_tmatrix_init(T->spec); size_t n = T->spec->n; for(size_t i = 0; i < n*n; ++i) - t->m = T->m; + t->m[i] = T->m[i]; return t; }