Changeset 13373
- Timestamp:
- 09/14/12 14:13:08 (13 years ago)
- Location:
- issm/trunk-jpl/src/c/python/io
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/python/io/FetchPythonData.cpp
r13372 r13373 66 66 double* matrix=NULL; 67 67 int M,N; 68 int i,ndim;68 int ndim; 69 69 npy_intp* dims=NULL; 70 70 … … 80 80 /*copy matrix: */ 81 81 matrix=xNew<double>(M*N); 82 for(i=0;i<M*N;i++)matrix[i]=dmatrix[i];82 memcpy(matrix,dmatrix,(M*N)*sizeof(double)); 83 83 84 84 /*output: */ … … 127 127 double* vector=NULL; 128 128 int M; 129 int i,ndim;129 int ndim; 130 130 npy_intp* dims=NULL; 131 131 … … 141 141 /*copy vector: */ 142 142 vector=xNew<double>(M); 143 for(i=0;i<M;i++)vector[i]=dvector[i];143 memcpy(vector,dvector,(M)*sizeof(double)); 144 144 145 145 /*output: */ … … 233 233 } 234 234 /*}}}*/ 235 /*FUNCTION FetchData(Options** poptions,int istart, int nrhs,PyObject* arguments){{{*/ 236 void FetchData(Options** poptions,int istart, int nrhs,PyObject* arguments){ 235 /*FUNCTION FetchData(Options** poptions,int istart, int nrhs,PyObject* py_args){{{*/ 236 void FetchData(Options** poptions,int istart, int nrhs,PyObject* py_tuple){ 237 238 char *name = NULL; 239 Option *option = NULL; 237 240 238 241 /*Initialize output*/ 239 242 Options* options=new Options(); 240 243 241 _pprintLine_("FetchData for Options not implemented yet, ignoring them!"); 244 /*Fetch all options*/ 245 for (int i=istart; i<nrhs; i=i+2){ 246 if (!PyString_Check(PyTuple_GetItem(py_tuple,(Py_ssize_t)i))) _error_("Argument " << i+1 << " must be name of option"); 247 248 FetchData(&name,PyTuple_GetItem(py_tuple,(Py_ssize_t)i)); 249 if(i+1 == nrhs) _error_("Argument " << i+2 << " must exist and be value of option \"" << name << "\"."); 250 251 // _pprintLine_("FetchData for Options not implemented yet, ignoring them!"); 252 _printf_(1,"FetchData for Options not implemented yet, ignoring option '%s'!",name); 253 254 // option=(Option*)OptionParse(name,&PyTuple_GetItem(py_tuple,(Py_ssize_t)(i+1))); 255 // options->AddOption(option); 256 // option=NULL; 257 } 242 258 243 259 /*Assign output pointers:*/ 244 260 *poptions=options; 245 246 261 } 247 262 /*}}}*/ -
issm/trunk-jpl/src/c/python/io/pythonio.h
r13368 r13373 34 34 void FetchData(BamgMesh** bamgmesh,PyObject* py_dict); 35 35 void FetchData(BamgOpts** bamgopts,PyObject* py_dict); 36 void FetchData(Options** poptions,int istart, int nrhs,PyObject* arguments);36 void FetchData(Options** poptions,int istart, int nrhs,PyObject* py_tuple); 37 37 void FetchData(DataSet** pcontours,PyObject* py_list); 38 38
Note:
See TracChangeset
for help on using the changeset viewer.