@@ -227,12 +227,19 @@ void fillPyListWithSets(::boost::python::list lst, const T& value)
227227// / Type for numpy array object and a raw pointer to its double data
228228typedef std::pair<boost::python::object, double *> NumPyArray_DoublePtr;
229229
230+
230231// / helper for creating numpy array of doubles
231232NumPyArray_DoublePtr createNumPyDoubleArray (int dim, const int * sz);
232233
234+
235+ // / helper for creating numpy array of the same shape as the argument
236+ NumPyArray_DoublePtr createNumPyDoubleArrayLike (boost::python::object& obj);
237+
238+
233239// / helper for creating numpy views on existing double array
234240boost::python::object createNumPyDoubleView (double *, int dim, const int * sz);
235241
242+
236243// / template function for converting iterables to numpy array of doubles
237244template <class Iter >
238245::boost::python::object
@@ -296,25 +303,31 @@ convertToNumPyArray(const ::diffpy::srreal::QuantityType& value)
296303 return convertToNumPyArray (value.begin (), value.end ());
297304}
298305
306+
299307// / NumPy array view specializations for R3::Vector
300308boost::python::object
301309viewAsNumPyArray (::diffpy::srreal::R3::Vector&);
302310
311+
303312// / NumPy array view specializations for R3::Matrix
304313boost::python::object
305314viewAsNumPyArray (::diffpy::srreal::R3::Matrix&);
306315
316+
307317// / Copy possible NumPy array to R3::Vector
308318void assignR3Vector (
309319 ::diffpy::srreal::R3::Vector& dst, boost::python::object& value);
310320
321+
311322// / Copy possible NumPy array to R3::Matrix
312323void assignR3Matrix (
313324 ::diffpy::srreal::R3::Matrix& dst, boost::python::object& value);
314325
326+
315327// / Type for numpy array object and a raw pointer to its double data
316328typedef std::pair<boost::python::object, int *> NumPyArray_IntPtr;
317329
330+
318331// / helper for creating numpy array of integers
319332NumPyArray_IntPtr createNumPyIntArray (int dim, const int * sz);
320333
@@ -361,6 +374,10 @@ extractQuantityType(::boost::python::object obj,
361374 ::diffpy::srreal::QuantityType& rv);
362375
363376
377+ // / efficient conversion of Python object to a numpy array of doubles
378+ NumPyArray_DoublePtr extractNumPyDoubleArray (::boost::python::object& obj);
379+
380+
364381// / extract integer with a support for numpy.int types
365382int extractint (::boost::python::object obj);
366383
0 commit comments