From bc5a024e86e687f9405ca10d0f50767c8d2240c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Tue, 21 Jan 2020 11:52:45 +0200 Subject: [PATCH] Fix another stupid bugs Former-commit-id: 093b5d5f09ac6a6f9be35fb7e20f73b2ba48f1d6 --- qpms/qpms_c.pyx | 1 + qpms/scatsystem.c | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/qpms/qpms_c.pyx b/qpms/qpms_c.pyx index 47d3b52..5a6e203 100644 --- a/qpms/qpms_c.pyx +++ b/qpms/qpms_c.pyx @@ -425,6 +425,7 @@ cdef class ScatteringSystem: cdef _ScatteringSystemAtOmega pyssw = _ScatteringSystemAtOmega() pyssw.ssw = qpms_scatsys_at_omega(self.s, omega) pyssw.ss_pyref = self + return pyssw def __dealloc__(self): if(self.s): diff --git a/qpms/scatsystem.c b/qpms/scatsystem.c index b6b1149..febef46 100644 --- a/qpms/scatsystem.c +++ b/qpms/scatsystem.c @@ -280,7 +280,7 @@ qpms_scatsys_at_omega_t *qpms_scatsys_apply_symmetry(const qpms_scatsys_t *orig, ss->tm[ss->tm_count].tmgi = ss->tm[tmi].tmgi; qpms_tmatrix_operation_compose_chain_init(&(ss->tm[ss->tm_count].op), 2, 1); struct qpms_tmatrix_operation_compose_chain * const o = &(ss->tm[ss->tm_count].op.op.compose_chain); - o->ops[0] = & ss->tm[tmj].op; // Let's just borrow this + o->ops[0] = & ss->tm[tmi].op; // Let's just borrow this o->ops_owned[0] = false; o->opmem[0].typ = QPMS_TMATRIX_OPERATION_LRMATRIX; o->opmem[0].op.lrmatrix.m = m; @@ -505,6 +505,7 @@ qpms_scatsys_at_omega_t *qpms_scatsys_at_omega(const qpms_scatsys_t *ss, ssw->ss = ss; ssw->medium = qpms_epsmu_generator_eval(ss->medium, omega); ssw->wavenumber = qpms_wavenumber(omega, ssw->medium); + QPMS_CRASHING_CALLOC(ssw->tm, ss->tm_count, sizeof(*ssw->tm)); qpms_tmatrix_t **tmatrices_preop; QPMS_CRASHING_CALLOC(tmatrices_preop, ss->tmg_count, sizeof(*tmatrices_preop)); for (qpms_ss_tmgi_t tmgi = 0; tmgi < ss->tmg_count; ++tmgi)