File tree Expand file tree Collapse file tree 1 file changed +0
-23
lines changed
Expand file tree Collapse file tree 1 file changed +0
-23
lines changed Original file line number Diff line number Diff line change @@ -360,29 +360,6 @@ template <> struct select_npy_type<uint64_t> {
360360 const static NPY_TYPES type = NPY_UINT64;
361361};
362362
363- // TODO change to Vector template so useable for Eigen vectors,
364- // should be enough since it also provides the end and begin methods
365- template <typename Vector> PyObject *get_array (const Vector &v) {
366- detail::_interpreter::get (); // interpreter needs to be initialized for the
367- // numpy commands to work
368- NPY_TYPES type = select_npy_type<typename Vector::value_type>::type;
369- if (type == NPY_NOTYPE) {
370- std::vector<double > vd (v.size ());
371- npy_intp vsize = v.size ();
372- // Eigen Vectors do not support begin/end() in the currently stable version
373- // this can be changed once Eigen 3.4. is released
374- std::copy (v.data (), v.data () + v.size (), vd.begin ());
375- PyObject *varray =
376- PyArray_SimpleNewFromData (1 , &vsize, NPY_DOUBLE, (void *)(vd.data ()));
377- return varray;
378- }
379-
380- npy_intp vsize = v.size ();
381- PyObject *varray =
382- PyArray_SimpleNewFromData (1 , &vsize, type, (void *)(v.data ()));
383- return varray;
384- }
385-
386363template <typename Vector> PyObject *get_array (const Vector &v) {
387364 detail::_interpreter::get (); // interpreter needs to be initialized for the
388365 // numpy commands to work
You can’t perform that action at this time.
0 commit comments