@@ -392,9 +392,7 @@ template <typename Vector> PyObject *get_array(const Vector &v) {
392392 return varray;
393393}
394394
395- // TODO maybe we have to add a function for Eigen matrices, not sure
396- // if the v[0] is valid for matrices and also the ::std::vector &v_row
397- // probably doesn't work
395+ // specialized get_2darray function for nested std::vectors
398396template <typename Numeric>
399397PyObject *get_2darray (const std::vector<::std::vector<Numeric>> &v) {
400398 detail::_interpreter::get (); // interpreter needs to be initialized for the
@@ -420,7 +418,7 @@ PyObject *get_2darray(const std::vector<::std::vector<Numeric>> &v) {
420418 return reinterpret_cast <PyObject *>(varray);
421419}
422420
423- // suitable for Eigen matrices
421+ // suitable for more general matrices (especially Eigen matrices)
424422template <typename Matrix>
425423PyObject *get_2darray (const Matrix &A) {
426424 detail::_interpreter::get (); // interpreter needs to be initialized for the
@@ -583,7 +581,7 @@ bool semilogx(const VectorX &x, const VectorY &y,
583581 return semilogx (x, y, " " , keywords);
584582}
585583
586- template <typename VectorY>
584+ template <typename VectorY = std::vector< double > >
587585bool semilogx (const VectorY &y, const std::string &s = " " ,
588586 const std::map<std::string, std::string> &keywords = {}) {
589587 std::vector<std::size_t > x (y.size ());
@@ -593,7 +591,7 @@ bool semilogx(const VectorY &y, const std::string &s = "",
593591 return semilogx (x, y, s, keywords);
594592}
595593
596- template <typename VectorY>
594+ template <typename VectorY = std::vector< double > >
597595bool semilogx (const VectorY &y,
598596 const std::map<std::string, std::string> &keywords) {
599597 std::vector<std::size_t > x (y.size ());
@@ -617,7 +615,7 @@ bool semilogy(const VectorX &x, const VectorY &y,
617615 return semilogy (x, y, " " , keywords);
618616}
619617
620- template <typename VectorY>
618+ template <typename VectorY = std::vector< double > >
621619bool semilogy (const VectorY &y, const std::string &s = " " ,
622620 const std::map<std::string, std::string> &keywords = {}) {
623621 std::vector<std::size_t > x (y.size ());
@@ -627,7 +625,7 @@ bool semilogy(const VectorY &y, const std::string &s = "",
627625 return semilogy (x, y, s, keywords);
628626}
629627
630- template <typename VectorY>
628+ template <typename VectorY = std::vector< double > >
631629bool semilogy (const VectorY &y,
632630 const std::map<std::string, std::string> &keywords) {
633631 std::vector<std::size_t > x (y.size ());
0 commit comments