From b578f305ac8f6d2a919347acea19ff23347c7ed9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marek=20Ne=C4=8Dada?= Date: Tue, 14 Jan 2020 19:09:26 +0200 Subject: [PATCH] Support for constant T-matrix generator in cython. Former-commit-id: 184f88b0acf453d09e67f03cf41db06b4b4015bb --- qpms/cytmatrices.pyx | 4 ++++ qpms/qpms_cdefs.pxd | 1 + 2 files changed, 5 insertions(+) diff --git a/qpms/cytmatrices.pyx b/qpms/cytmatrices.pyx index 6ca8afc..6cdfd4b 100644 --- a/qpms/cytmatrices.pyx +++ b/qpms/cytmatrices.pyx @@ -240,6 +240,10 @@ cdef class TMatrixGenerator: self.holder = what self.g.function = qpms_tmatrix_generator_axialsym self.g.params = (<__AxialSymParams?>self.holder).rawpointer() + elif isinstance(what, CTMatrix): + self.holder = what + self.g.function = qpms_tmatrix_generator_constant + self.g.params = (self.holder).rawpointer() # TODO INTERPOLATOR else: raise TypeError("Can't construct TMatrixGenerator from that") diff --git a/qpms/qpms_cdefs.pxd b/qpms/qpms_cdefs.pxd index bf083ad..9adf354 100644 --- a/qpms/qpms_cdefs.pxd +++ b/qpms/qpms_cdefs.pxd @@ -414,6 +414,7 @@ cdef extern from "tmatrices.h": qpms_errno_t qpms_tmatrix_generator_axialsym(qpms_tmatrix_t *t, cdouble omega, const void *params) qpms_errno_t qpms_tmatrix_generator_interpolator(qpms_tmatrix_t *t, cdouble omega, const void *params) qpms_errno_t qpms_tmatrix_generator_sphere(qpms_tmatrix_t *t, cdouble omega, const void *params) + qpms_errno_t qpms_tmatrix_generator_constant(qpms_tmatrix_t *t, cdouble omega, const void *params) struct qpms_tmatrix_generator_sphere_param_t: qpms_epsmu_generator_t outside qpms_epsmu_generator_t inside