Skip to content
Snippets Groups Projects
Commit ab28091f authored by Wilson Jallet's avatar Wilson Jallet :clapper:
Browse files

unittest/vector.cpp

remove useless include
remove comment between includes (not sorted by pre-commit anymore)

core/std-vector.hpp
* fix using-ctor for older cpp versions
* fix warning about conversion
parent bf7840fe
No related branches found
No related tags found
No related merge requests found
...@@ -112,7 +112,7 @@ struct overload_base_get_item_for_std_vector ...@@ -112,7 +112,7 @@ struct overload_base_get_item_for_std_vector
bp::extract<long> i(i_); bp::extract<long> i(i_);
if (i.check()) { if (i.check()) {
long index = i(); long index = i();
if (index < 0) index += container.size(); if (index < 0) index += (long)container.size();
if (index >= long(container.size()) || index < 0) { if (index >= long(container.size()) || index < 0) {
PyErr_SetString(PyExc_IndexError, "Index out of range"); PyErr_SetString(PyExc_IndexError, "Index out of range");
bp::throw_error_already_set(); bp::throw_error_already_set();
...@@ -158,7 +158,8 @@ struct extract<Eigen::Matrix<Scalar, Rows, Cols, Options, MaxRows, MaxCols> &> ...@@ -158,7 +158,8 @@ struct extract<Eigen::Matrix<Scalar, Rows, Cols, Options, MaxRows, MaxCols> &>
typedef Eigen::Matrix<Scalar, Rows, Cols, Options, MaxRows, MaxCols> typedef Eigen::Matrix<Scalar, Rows, Cols, Options, MaxRows, MaxCols>
MatrixType; MatrixType;
typedef extract_to_eigen_ref<MatrixType> base; typedef extract_to_eigen_ref<MatrixType> base;
using base::base; extract(PyObject *o) : base(o) {}
extract(api::object const &o) : base(o.ptr()) {}
}; };
template <typename Derived> template <typename Derived>
...@@ -166,7 +167,8 @@ struct extract<Eigen::MatrixBase<Derived> &> ...@@ -166,7 +167,8 @@ struct extract<Eigen::MatrixBase<Derived> &>
: extract_to_eigen_ref<Eigen::MatrixBase<Derived> > { : extract_to_eigen_ref<Eigen::MatrixBase<Derived> > {
typedef Eigen::MatrixBase<Derived> MatrixType; typedef Eigen::MatrixBase<Derived> MatrixType;
typedef extract_to_eigen_ref<MatrixType> base; typedef extract_to_eigen_ref<MatrixType> base;
using base::base; extract(PyObject *o) : base(o) {}
extract(api::object const &o) : base(o.ptr()) {}
}; };
template <typename Derived> template <typename Derived>
...@@ -174,7 +176,8 @@ struct extract<Eigen::RefBase<Derived> &> ...@@ -174,7 +176,8 @@ struct extract<Eigen::RefBase<Derived> &>
: extract_to_eigen_ref<Eigen::RefBase<Derived> > { : extract_to_eigen_ref<Eigen::RefBase<Derived> > {
typedef Eigen::RefBase<Derived> MatrixType; typedef Eigen::RefBase<Derived> MatrixType;
typedef extract_to_eigen_ref<MatrixType> base; typedef extract_to_eigen_ref<MatrixType> base;
using base::base; extract(PyObject *o) : base(o) {}
extract(api::object const &o) : base(o.ptr()) {}
}; };
namespace converter { namespace converter {
......
...@@ -6,7 +6,6 @@ ...@@ -6,7 +6,6 @@
#include <iostream> #include <iostream>
#include "eigenpy/eigenpy.hpp" #include "eigenpy/eigenpy.hpp"
// include main header first
#include "eigenpy/eigen-from-python.hpp" #include "eigenpy/eigen-from-python.hpp"
using namespace Eigen; using namespace Eigen;
......
/// @file
/// @copyright Copyright 2022, CNRS
/// @copyright Copyright 2022, INRIA
#include <ostream> #include <ostream>
#include <type_traits>
#include "eigenpy/eigenpy.hpp" #include "eigenpy/eigenpy.hpp"
// include main first
#include "eigenpy/eigen-from-python.hpp" #include "eigenpy/eigen-from-python.hpp"
#include "eigenpy/std-vector.hpp" #include "eigenpy/std-vector.hpp"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment