mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-07-21 04:14:26 +08:00
bug #1646: disable aliasing detection for empty and 1x1 expression
This commit is contained in:
parent
0b466b6933
commit
502f717980
@ -392,6 +392,7 @@ struct checkTransposeAliasing_impl<Derived, OtherDerived, false>
|
|||||||
template<typename Dst, typename Src>
|
template<typename Dst, typename Src>
|
||||||
void check_for_aliasing(const Dst &dst, const Src &src)
|
void check_for_aliasing(const Dst &dst, const Src &src)
|
||||||
{
|
{
|
||||||
|
if(src.size()>1)
|
||||||
internal::checkTransposeAliasing_impl<Dst, Src>::run(dst, src);
|
internal::checkTransposeAliasing_impl<Dst, Src>::run(dst, src);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -171,6 +171,17 @@ void adjoint_extra()
|
|||||||
c = MatrixXd::Ones(10,10) * 1.0 + c;
|
c = MatrixXd::Ones(10,10) * 1.0 + c;
|
||||||
c = c + MatrixXd::Ones(10,10) .cwiseProduct( MatrixXd::Zero(10,10) );
|
c = c + MatrixXd::Ones(10,10) .cwiseProduct( MatrixXd::Zero(10,10) );
|
||||||
c = MatrixXd::Ones(10,10) * MatrixXd::Zero(10,10);
|
c = MatrixXd::Ones(10,10) * MatrixXd::Zero(10,10);
|
||||||
|
|
||||||
|
// regression for bug 1646
|
||||||
|
for (int j = 0; j < 10; ++j) {
|
||||||
|
c.col(j).head(j) = c.row(j).head(j);
|
||||||
|
}
|
||||||
|
|
||||||
|
a.conservativeResize(1,1);
|
||||||
|
a = a.transpose();
|
||||||
|
|
||||||
|
a.conservativeResize(0,0);
|
||||||
|
a = a.transpose();
|
||||||
}
|
}
|
||||||
|
|
||||||
EIGEN_DECLARE_TEST(adjoint)
|
EIGEN_DECLARE_TEST(adjoint)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user