@@ -392,9 +392,7 @@ template <typename Vector> PyObject *get_array(const Vector &v) {
392
392
return varray;
393
393
}
394
394
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
398
396
template <typename Numeric>
399
397
PyObject *get_2darray (const std::vector<::std::vector<Numeric>> &v) {
400
398
detail::_interpreter::get (); // interpreter needs to be initialized for the
@@ -420,7 +418,7 @@ PyObject *get_2darray(const std::vector<::std::vector<Numeric>> &v) {
420
418
return reinterpret_cast <PyObject *>(varray);
421
419
}
422
420
423
- // suitable for Eigen matrices
421
+ // suitable for more general matrices (especially Eigen matrices)
424
422
template <typename Matrix>
425
423
PyObject *get_2darray (const Matrix &A) {
426
424
detail::_interpreter::get (); // interpreter needs to be initialized for the
@@ -583,7 +581,7 @@ bool semilogx(const VectorX &x, const VectorY &y,
583
581
return semilogx (x, y, " " , keywords);
584
582
}
585
583
586
- template <typename VectorY>
584
+ template <typename VectorY = std::vector< double > >
587
585
bool semilogx (const VectorY &y, const std::string &s = " " ,
588
586
const std::map<std::string, std::string> &keywords = {}) {
589
587
std::vector<std::size_t > x (y.size ());
@@ -593,7 +591,7 @@ bool semilogx(const VectorY &y, const std::string &s = "",
593
591
return semilogx (x, y, s, keywords);
594
592
}
595
593
596
- template <typename VectorY>
594
+ template <typename VectorY = std::vector< double > >
597
595
bool semilogx (const VectorY &y,
598
596
const std::map<std::string, std::string> &keywords) {
599
597
std::vector<std::size_t > x (y.size ());
@@ -617,7 +615,7 @@ bool semilogy(const VectorX &x, const VectorY &y,
617
615
return semilogy (x, y, " " , keywords);
618
616
}
619
617
620
- template <typename VectorY>
618
+ template <typename VectorY = std::vector< double > >
621
619
bool semilogy (const VectorY &y, const std::string &s = " " ,
622
620
const std::map<std::string, std::string> &keywords = {}) {
623
621
std::vector<std::size_t > x (y.size ());
@@ -627,7 +625,7 @@ bool semilogy(const VectorY &y, const std::string &s = "",
627
625
return semilogy (x, y, s, keywords);
628
626
}
629
627
630
- template <typename VectorY>
628
+ template <typename VectorY = std::vector< double > >
631
629
bool semilogy (const VectorY &y,
632
630
const std::map<std::string, std::string> &keywords) {
633
631
std::vector<std::size_t > x (y.size ());
0 commit comments