Changeset 26565
- Timestamp:
- 11/09/21 06:53:57 (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/wrappers/python/io/FetchPythonData.cpp
r24502 r26565 189 189 long* lmatrix=NULL; 190 190 bool* bmatrix=NULL; 191 float* smatrix=NULL; 191 192 int i; 192 193 PyObject* py_matrix2=NULL; … … 212 213 } 213 214 214 if (PyArray_TYPE((PyArrayObject*)py_matrix) == NPY_DOUBLE) { 215 if (PyArray_TYPE((PyArrayObject*)py_matrix) == NPY_FLOAT) { 216 /*retrieve internal value: */ 217 smatrix=(float*)PyArray_DATA((PyArrayObject*)py_matrix); 218 219 /*transform into double matrix: */ 220 matrix=xNew<double>(M*N); 221 for(i=0;i<M*N;i++)matrix[i]=(double)smatrix[i]; 222 } 223 224 else if (PyArray_TYPE((PyArrayObject*)py_matrix) == NPY_DOUBLE) { 215 225 /*retrieve internal value: */ 216 226 dmatrix=(double*)PyArray_DATA((PyArrayObject*)py_matrix); … … 558 568 long* lvector=NULL; 559 569 bool* bvector=NULL; 570 float* svector=NULL; 560 571 int i; 561 572 PyObject* py_vector2=NULL; … … 584 595 } 585 596 586 if (PyArray_TYPE((PyArrayObject*)py_vector) == NPY_DOUBLE) { 597 if (PyArray_TYPE((PyArrayObject*)py_vector) == NPY_FLOAT) { 598 /*retrieve internal value: */ 599 svector=(float*)PyArray_DATA((PyArrayObject*)py_vector); 600 601 /*transform into double matrix: */ 602 vector=xNew<double>(M); 603 for(i=0;i<M;i++)vector[i]=(double)svector[i]; 604 } 605 else if (PyArray_TYPE((PyArrayObject*)py_vector) == NPY_DOUBLE) { 587 606 /*retrieve internal value: */ 588 607 dvector=(double*)PyArray_DATA((PyArrayObject*)py_vector);
Note:
See TracChangeset
for help on using the changeset viewer.