From 8b8d002d429ca9f26c18447b5f5b2f4595bf56a9 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: 31024cb82d94fad7c1bbb9be91be8041611d6651 --- 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 29c8d7c..63bbc14 100644 --- a/qpms/cytmatrices.pyx +++ b/qpms/cytmatrices.pyx @@ -244,6 +244,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 56ac441..7e9bcd7 100644 --- a/qpms/qpms_cdefs.pxd +++ b/qpms/qpms_cdefs.pxd @@ -408,6 +408,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