@@ -3456,6 +3456,16 @@ nmt_workspace *comp_coupling_matrix(int spin1,int spin2,
34563456 norm_type, w2);
34573457}
34583458
3459+ void comp_general_coupling_matrix(int s1, int s2, int n1, int n2, int lmax,
3460+ int nell4,double *f_ell,
3461+ double *dout,int ndout)
3462+ {
3463+ asserting(nell4==lmax+1);
3464+ asserting(ndout==nell4*nell4);
3465+ memset(dout,0,ndout*sizeof(double));
3466+ nmt_compute_general_coupling_matrix(lmax,f_ell,s1,s2,n1,n2,dout);
3467+ }
3468+
34593469nmt_workspace_flat *comp_coupling_matrix_flat(nmt_field_flat *fl1,nmt_field_flat *fl2,
34603470 nmt_binning_scheme_flat *bin,
34613471 double lmn_x,double lmx_x,double lmn_y,double lmx_y,
@@ -11628,6 +11638,75 @@ SWIGINTERN PyObject *_wrap_compute_coupling_matrix_anisotropic(PyObject *SWIGUNU
1162811638}
1162911639
1163011640
11641+ SWIGINTERN PyObject *_wrap_compute_general_coupling_matrix(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
11642+ PyObject *resultobj = 0;
11643+ int arg1 ;
11644+ flouble *arg2 = (flouble *) 0 ;
11645+ int arg3 ;
11646+ int arg4 ;
11647+ int arg5 ;
11648+ int arg6 ;
11649+ flouble *arg7 = (flouble *) 0 ;
11650+ int val1 ;
11651+ int ecode1 = 0 ;
11652+ void *argp2 = 0 ;
11653+ int res2 = 0 ;
11654+ int val3 ;
11655+ int ecode3 = 0 ;
11656+ int val4 ;
11657+ int ecode4 = 0 ;
11658+ int val5 ;
11659+ int ecode5 = 0 ;
11660+ int val6 ;
11661+ int ecode6 = 0 ;
11662+ void *argp7 = 0 ;
11663+ int res7 = 0 ;
11664+ PyObject *swig_obj[7] ;
11665+
11666+ if (!SWIG_Python_UnpackTuple(args, "compute_general_coupling_matrix", 7, 7, swig_obj)) SWIG_fail;
11667+ ecode1 = SWIG_AsVal_int(swig_obj[0], &val1);
11668+ if (!SWIG_IsOK(ecode1)) {
11669+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "compute_general_coupling_matrix" "', argument " "1"" of type '" "int""'");
11670+ }
11671+ arg1 = (int)(val1);
11672+ res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_double, 0 | 0 );
11673+ if (!SWIG_IsOK(res2)) {
11674+ SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "compute_general_coupling_matrix" "', argument " "2"" of type '" "flouble *""'");
11675+ }
11676+ arg2 = (flouble *)(argp2);
11677+ ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
11678+ if (!SWIG_IsOK(ecode3)) {
11679+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "compute_general_coupling_matrix" "', argument " "3"" of type '" "int""'");
11680+ }
11681+ arg3 = (int)(val3);
11682+ ecode4 = SWIG_AsVal_int(swig_obj[3], &val4);
11683+ if (!SWIG_IsOK(ecode4)) {
11684+ SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "compute_general_coupling_matrix" "', argument " "4"" of type '" "int""'");
11685+ }
11686+ arg4 = (int)(val4);
11687+ ecode5 = SWIG_AsVal_int(swig_obj[4], &val5);
11688+ if (!SWIG_IsOK(ecode5)) {
11689+ SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "compute_general_coupling_matrix" "', argument " "5"" of type '" "int""'");
11690+ }
11691+ arg5 = (int)(val5);
11692+ ecode6 = SWIG_AsVal_int(swig_obj[5], &val6);
11693+ if (!SWIG_IsOK(ecode6)) {
11694+ SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "compute_general_coupling_matrix" "', argument " "6"" of type '" "int""'");
11695+ }
11696+ arg6 = (int)(val6);
11697+ res7 = SWIG_ConvertPtr(swig_obj[6], &argp7,SWIGTYPE_p_double, 0 | 0 );
11698+ if (!SWIG_IsOK(res7)) {
11699+ SWIG_exception_fail(SWIG_ArgError(res7), "in method '" "compute_general_coupling_matrix" "', argument " "7"" of type '" "flouble *""'");
11700+ }
11701+ arg7 = (flouble *)(argp7);
11702+ nmt_compute_general_coupling_matrix(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
11703+ resultobj = SWIG_Py_Void();
11704+ return resultobj;
11705+ fail:
11706+ return NULL;
11707+ }
11708+
11709+
1163111710SWIGINTERN PyObject *_wrap_compute_coupling_matrix(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
1163211711 PyObject *resultobj = 0;
1163311712 int arg1 ;
@@ -16756,6 +16835,116 @@ SWIGINTERN PyObject *_wrap_comp_coupling_matrix(PyObject *SWIGUNUSEDPARM(self),
1675616835}
1675716836
1675816837
16838+ SWIGINTERN PyObject *_wrap_comp_general_coupling_matrix(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
16839+ PyObject *resultobj = 0;
16840+ int arg1 ;
16841+ int arg2 ;
16842+ int arg3 ;
16843+ int arg4 ;
16844+ int arg5 ;
16845+ int arg6 ;
16846+ double *arg7 = (double *) 0 ;
16847+ double *arg8 = (double *) 0 ;
16848+ int arg9 ;
16849+ int val1 ;
16850+ int ecode1 = 0 ;
16851+ int val2 ;
16852+ int ecode2 = 0 ;
16853+ int val3 ;
16854+ int ecode3 = 0 ;
16855+ int val4 ;
16856+ int ecode4 = 0 ;
16857+ int val5 ;
16858+ int ecode5 = 0 ;
16859+ PyArrayObject *array6 = NULL ;
16860+ int is_new_object6 = 0 ;
16861+ PyObject *array8 = NULL ;
16862+ PyObject *swig_obj[7] ;
16863+
16864+ if (!SWIG_Python_UnpackTuple(args, "comp_general_coupling_matrix", 7, 7, swig_obj)) SWIG_fail;
16865+ ecode1 = SWIG_AsVal_int(swig_obj[0], &val1);
16866+ if (!SWIG_IsOK(ecode1)) {
16867+ SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "comp_general_coupling_matrix" "', argument " "1"" of type '" "int""'");
16868+ }
16869+ arg1 = (int)(val1);
16870+ ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
16871+ if (!SWIG_IsOK(ecode2)) {
16872+ SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "comp_general_coupling_matrix" "', argument " "2"" of type '" "int""'");
16873+ }
16874+ arg2 = (int)(val2);
16875+ ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
16876+ if (!SWIG_IsOK(ecode3)) {
16877+ SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "comp_general_coupling_matrix" "', argument " "3"" of type '" "int""'");
16878+ }
16879+ arg3 = (int)(val3);
16880+ ecode4 = SWIG_AsVal_int(swig_obj[3], &val4);
16881+ if (!SWIG_IsOK(ecode4)) {
16882+ SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "comp_general_coupling_matrix" "', argument " "4"" of type '" "int""'");
16883+ }
16884+ arg4 = (int)(val4);
16885+ ecode5 = SWIG_AsVal_int(swig_obj[4], &val5);
16886+ if (!SWIG_IsOK(ecode5)) {
16887+ SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "comp_general_coupling_matrix" "', argument " "5"" of type '" "int""'");
16888+ }
16889+ arg5 = (int)(val5);
16890+ {
16891+ npy_intp size[1] = {
16892+ -1
16893+ };
16894+ array6 = obj_to_array_contiguous_allow_conversion(swig_obj[5],
16895+ NPY_DOUBLE,
16896+ &is_new_object6);
16897+ if (!array6 || !require_dimensions(array6, 1) ||
16898+ !require_size(array6, size, 1)) SWIG_fail;
16899+ arg6 = (int) array_size(array6,0);
16900+ arg7 = (double*) array_data(array6);
16901+ }
16902+ {
16903+ npy_intp dims[1];
16904+ if (!PyInt_Check(swig_obj[6]))
16905+ {
16906+ const char* typestring = pytype_string(swig_obj[6]);
16907+ PyErr_Format(PyExc_TypeError,
16908+ "Int dimension expected. '%s' given.",
16909+ typestring);
16910+ SWIG_fail;
16911+ }
16912+ arg9 = (int) PyInt_AsLong(swig_obj[6]);
16913+ dims[0] = (npy_intp) arg9;
16914+ array8 = PyArray_SimpleNew(1, dims, NPY_DOUBLE);
16915+ if (!array8) SWIG_fail;
16916+ arg8 = (double*) array_data(array8);
16917+ }
16918+ {
16919+ try {
16920+ comp_general_coupling_matrix(arg1,arg2,arg3,arg4,arg5,arg6,arg7,arg8,arg9);
16921+ }
16922+ finally {
16923+ SWIG_exception(SWIG_RuntimeError,nmt_error_message);
16924+ }
16925+ }
16926+ resultobj = SWIG_Py_Void();
16927+ {
16928+ resultobj = SWIG_Python_AppendOutput(resultobj,(PyObject*)array8);
16929+ }
16930+ {
16931+ if (is_new_object6 && array6)
16932+ {
16933+ Py_DECREF(array6);
16934+ }
16935+ }
16936+ return resultobj;
16937+ fail:
16938+ {
16939+ if (is_new_object6 && array6)
16940+ {
16941+ Py_DECREF(array6);
16942+ }
16943+ }
16944+ return NULL;
16945+ }
16946+
16947+
1675916948SWIGINTERN PyObject *_wrap_comp_coupling_matrix_flat(PyObject *SWIGUNUSEDPARM(self), PyObject *args) {
1676016949 PyObject *resultobj = 0;
1676116950 nmt_field_flat *arg1 = (nmt_field_flat *) 0 ;
@@ -19356,6 +19545,7 @@ static PyMethodDef SwigMethods[] = {
1935619545 { "compute_master_coefficients", _wrap_compute_master_coefficients, METH_VARARGS, NULL},
1935719546 { "master_calculator_free", _wrap_master_calculator_free, METH_O, NULL},
1935819547 { "compute_coupling_matrix_anisotropic", _wrap_compute_coupling_matrix_anisotropic, METH_VARARGS, NULL},
19548+ { "compute_general_coupling_matrix", _wrap_compute_general_coupling_matrix, METH_VARARGS, NULL},
1935919549 { "compute_coupling_matrix", _wrap_compute_coupling_matrix, METH_VARARGS, NULL},
1936019550 { "update_coupling_matrix", _wrap_update_coupling_matrix, METH_VARARGS, NULL},
1936119551 { "workspace_update_binning", _wrap_workspace_update_binning, METH_VARARGS, NULL},
@@ -19453,6 +19643,7 @@ static PyMethodDef SwigMethods[] = {
1945319643 { "synfast_new_flat", _wrap_synfast_new_flat, METH_VARARGS, NULL},
1945419644 { "comp_coupling_matrix_anisotropic", _wrap_comp_coupling_matrix_anisotropic, METH_VARARGS, NULL},
1945519645 { "comp_coupling_matrix", _wrap_comp_coupling_matrix, METH_VARARGS, NULL},
19646+ { "comp_general_coupling_matrix", _wrap_comp_general_coupling_matrix, METH_VARARGS, NULL},
1945619647 { "comp_coupling_matrix_flat", _wrap_comp_coupling_matrix_flat, METH_VARARGS, NULL},
1945719648 { "read_workspace", _wrap_read_workspace, METH_VARARGS, NULL},
1945819649 { "write_workspace", _wrap_write_workspace, METH_VARARGS, NULL},
0 commit comments