Fix memset size in Mie T-matrix generator.

Former-commit-id: 244dad82dec42fdc1e08cc12205e373711465622
This commit is contained in:
Marek Nečada 2019-10-02 17:42:37 +03:00
parent c7f2e32ee4
commit 0239a3c9a1
1 changed files with 1 additions and 1 deletions

View File

@ -570,7 +570,7 @@ qpms_errno_t qpms_tmatrix_spherical_fill(qpms_tmatrix_t *t, ///< T-matrix whose
qpms_l_t lMax = t->spec->lMax; qpms_l_t lMax = t->spec->lMax;
complex double *miecoeffs = qpms_mie_coefficients_reflection(NULL, t->spec, a, k_i, k_e, mu_i, mu_e, complex double *miecoeffs = qpms_mie_coefficients_reflection(NULL, t->spec, a, k_i, k_e, mu_i, mu_e,
QPMS_BESSEL_REGULAR, QPMS_HANKEL_PLUS); QPMS_BESSEL_REGULAR, QPMS_HANKEL_PLUS);
memset(t->m, 0, SQ(t->spec->n)); memset(t->m, 0, SQ(t->spec->n)*sizeof(complex double));
for(size_t i = 0; i < t->spec->n; ++i) for(size_t i = 0; i < t->spec->n; ++i)
t->m[t->spec->n*i + i] = miecoeffs[i]; t->m[t->spec->n*i + i] = miecoeffs[i];
free(miecoeffs); free(miecoeffs);