mirror of
https://github.com/pybind/pybind11.git
synced 2024-11-25 14:45:12 +00:00
fix: remove redundant copy operation to fix warning (#3486)
* fix compiler warning: deprecated implicit copy constructor * take care of the bug http://eigen.tuxfamily.org/bz/show_bug.cgi?id=747 * add parenthesis for better reading * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Update include/pybind11/eigen.h Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> Co-authored-by: Henry Schreiner <HenrySchreinerIII@gmail.com>
This commit is contained in:
parent
9281faf429
commit
5d067e870a
@ -80,14 +80,12 @@ template <bool EigenRowMajor> struct EigenConformable {
|
||||
// Matrix type:
|
||||
EigenConformable(EigenIndex r, EigenIndex c,
|
||||
EigenIndex rstride, EigenIndex cstride) :
|
||||
conformable{true}, rows{r}, cols{c} {
|
||||
conformable{true}, rows{r}, cols{c},
|
||||
//TODO: when Eigen bug #747 is fixed, remove the tests for non-negativity. http://eigen.tuxfamily.org/bz/show_bug.cgi?id=747
|
||||
if (rstride < 0 || cstride < 0) {
|
||||
negativestrides = true;
|
||||
} else {
|
||||
stride = {EigenRowMajor ? rstride : cstride /* outer stride */,
|
||||
EigenRowMajor ? cstride : rstride /* inner stride */ };
|
||||
}
|
||||
stride{EigenRowMajor ? (rstride > 0 ? rstride : 0) : (cstride > 0 ? cstride : 0) /* outer stride */,
|
||||
EigenRowMajor ? (cstride > 0 ? cstride : 0) : (rstride > 0 ? rstride : 0) /* inner stride */ },
|
||||
negativestrides{rstride < 0 || cstride < 0} {
|
||||
|
||||
}
|
||||
// Vector type:
|
||||
EigenConformable(EigenIndex r, EigenIndex c, EigenIndex stride)
|
||||
|
Loading…
Reference in New Issue
Block a user