@@ -298,7 +298,7 @@ template <> struct select_npy_type<uint32_t> { const static NPY_TYPES type = NPY
298
298
template <> struct select_npy_type <uint64_t > { const static NPY_TYPES type = NPY_UINT64; };
299
299
300
300
template <typename Numeric>
301
- PyObject* get_array (const std::vector<Numeric>& v)
301
+ inline PyObject* get_array (const std::vector<Numeric>& v)
302
302
{
303
303
detail::_interpreter::get (); // interpreter needs to be initialized for the numpy commands to work
304
304
NPY_TYPES type = select_npy_type<Numeric>::type;
@@ -343,7 +343,7 @@ PyObject* get_2darray(const std::vector<::std::vector<Numeric>>& v)
343
343
#else // fallback if we don't have numpy: copy every element of the given vector
344
344
345
345
template <typename Numeric>
346
- PyObject* get_array (const std::vector<Numeric>& v)
346
+ inline PyObject* get_array (const std::vector<Numeric>& v)
347
347
{
348
348
PyObject* list = PyList_New (v.size ());
349
349
for (size_t i = 0 ; i < v.size (); ++i) {
@@ -355,7 +355,7 @@ PyObject* get_array(const std::vector<Numeric>& v)
355
355
#endif // WITHOUT_NUMPY
356
356
357
357
// sometimes, for labels and such, we need string arrays
358
- PyObject * get_array (const std::vector<std::string>& strings)
358
+ inline PyObject * get_array (const std::vector<std::string>& strings)
359
359
{
360
360
PyObject* list = PyList_New (strings.size ());
361
361
for (std::size_t i = 0 ; i < strings.size (); ++i) {
@@ -1322,7 +1322,7 @@ void text(Numeric x, Numeric y, const std::string& s = "")
1322
1322
Py_DECREF (res);
1323
1323
}
1324
1324
1325
- void colorbar (PyObject* mappable = NULL , const std::map<std::string, float >& keywords = {})
1325
+ inline void colorbar (PyObject* mappable = NULL , const std::map<std::string, float >& keywords = {})
1326
1326
{
1327
1327
if (mappable == NULL )
1328
1328
throw std::runtime_error (" Must call colorbar with PyObject* returned from an image, contour, surface, etc." );
@@ -1700,7 +1700,7 @@ inline void axis(const std::string &axisstr)
1700
1700
Py_DECREF (res);
1701
1701
}
1702
1702
1703
- void axvline (double x, double ymin = 0 ., double ymax = 1 ., const std::map<std::string, std::string>& keywords = std::map<std::string, std::string>())
1703
+ inline void axvline (double x, double ymin = 0 ., double ymax = 1 ., const std::map<std::string, std::string>& keywords = std::map<std::string, std::string>())
1704
1704
{
1705
1705
// construct positional args
1706
1706
PyObject* args = PyTuple_New (3 );
0 commit comments