Skip to content

Commit 4ba2bf4

Browse files
committed
fix get_array defined twice
1 parent ad0bd6b commit 4ba2bf4

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

matplotlibcpp.h

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff 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-
386363
template <typename Vector> PyObject *get_array(const Vector &v) {
387364
detail::_interpreter::get(); // interpreter needs to be initialized for the
388365
// numpy commands to work

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy