Changeset 12120
- Timestamp:
- 04/24/12 21:44:26 (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
r12112 r12120 81 81 } 82 82 /*}}}*/ 83 /*FUNCTION FetchData(double** pvector,int* pM, PyObject* py_vector){{{1*/ 84 void FetchData(double** pvector,int* pM,PyObject* py_vector){ 85 86 /*output: */ 87 double* vector=NULL; 88 int M; 89 int ndim; 90 npy_intp* dims=NULL; 91 92 /*retrive dimensions: */ 93 ndim=PyArray_NDIM((const PyArrayObject*)py_vector); 94 if(ndim!=1)_error_("expecting an Mx1 vector in input!"); 95 dims=PyArray_DIMS((PyArrayObject*)py_vector); 96 M=dims[0]; 97 98 /*retrieve internal value: */ 99 vector=(double*)PyArray_DATA((PyArrayObject*)py_vector); 100 101 /*output: */ 102 if(pM)*pM=M; 103 if(pvector)*pvector=vector; 104 } 105 /*}}}*/ 83 106 84 107 /*Python version dependent: */ -
issm/trunk-jpl/src/c/python/io/pythonio.h
r12112 r12120 41 41 //void FetchData(int** pvector,int* pM,PyObject* py_ref); 42 42 //void FetchData(float** pvector,int* pM,PyObject* py_ref); 43 //void FetchData(double** pvector,int* pM,PyObject* py_ref);44 43 //void FetchData(bool** pvector,int* pM,PyObject* py_ref); 45 44 //void FetchData(Vector** pvector,PyObject* py_ref); 46 45 //void FetchData(char** pmatrix,int* pnumel,int* pndims,int** psize,PyObject* py_ref); 47 46 //void FetchData(Parameters** pparameters, DataHandle py_ref); 47 void FetchData(double** pvector,int* pM,PyObject* py_ref); 48 48 void FetchData(double** pmatrix,int* pM,int *pN,PyObject* py_array); 49 49 void FetchData(char** pstring,PyObject* py_unicode);
Note:
See TracChangeset
for help on using the changeset viewer.