Changeset 9624cda in sasview for sansmodels/src/c_gen/sld2i_module.cpp
- Timestamp:
- Mar 13, 2013 9:10:51 AM (11 years ago)
- Branches:
- master, ESS_GUI, ESS_GUI_Docs, ESS_GUI_batch_fitting, ESS_GUI_bumps_abstraction, ESS_GUI_iss1116, ESS_GUI_iss879, ESS_GUI_iss959, ESS_GUI_opencl, ESS_GUI_ordering, ESS_GUI_sync_sascalc, costrafo411, magnetic_scatt, release-4.1.1, release-4.1.2, release-4.2.2, release_4.0.1, ticket-1009, ticket-1094-headless, ticket-1242-2d-resolution, ticket-1243, ticket-1249, ticket885, unittest-saveload
- Children:
- 49a8843
- Parents:
- 5f248f6
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
sansmodels/src/c_gen/sld2i_module.cpp
rb1174ec r9624cda 75 75 76 76 /** 77 * GenI the given input according to a given object77 * GenI the given input (2D) according to a given object 78 78 */ 79 PyObject * genicom_input (PyObject *, PyObject *args) {79 PyObject * genicom_inputXY(PyObject *, PyObject *args) { 80 80 int npoints; 81 81 PyObject *qx_obj; … … 100 100 GenI* s = static_cast<GenI *>(temp); 101 101 102 s->genicom (npoints, qx, qy, I_out);102 s->genicomXY(npoints, qx, qy, I_out); 103 103 //return PyCObject_FromVoidPtr(s, del_genicom); 104 104 return Py_BuildValue("i",1); 105 105 } 106 106 107 /** 108 * GenI the given 1D input according to a given object 109 */ 110 PyObject * genicom_input(PyObject *, PyObject *args) { 111 int npoints; 112 PyObject *q_obj; 113 double *q; 114 PyObject *I_out_obj; 115 Py_ssize_t n_out; 116 double *I_out; 117 PyObject *gen_obj; 118 119 if (!PyArg_ParseTuple(args, "OiOO", &gen_obj, &npoints, &q_obj, &I_out_obj)) return NULL; 120 OUTVECTOR(q_obj, q, n_out); 121 OUTVECTOR(I_out_obj, I_out, n_out); 122 123 // Sanity check 124 //if(n_in!=n_out) return Py_BuildValue("i",-1); 125 126 // Set the array pointers 127 void *temp = PyCObject_AsVoidPtr(gen_obj); 128 GenI* s = static_cast<GenI *>(temp); 129 130 s->genicom(npoints, q, I_out); 131 //return PyCObject_FromVoidPtr(s, del_genicom); 132 return Py_BuildValue("i",1); 133 } 107 134 108 135 /** … … 113 140 "Create a new GenI object"}, 114 141 {"genicom",(PyCFunction)genicom_input, METH_VARARGS, 115 "genicom the given input arrays"}, 142 "genicom the given 1d input arrays"}, 143 {"genicomXY",(PyCFunction)genicom_inputXY, METH_VARARGS, 144 "genicomXY the given 2d input arrays"}, 116 145 {NULL} 117 146 };
Note: See TracChangeset
for help on using the changeset viewer.