- many updates after Cwise change

- fix compilation in product.cpp with std::complex
- fix bug in MatrixBase::operator!=
This commit is contained in:
Benoit Jacob
2008-07-08 07:56:01 +00:00
parent f5791eeb70
commit 6f09d3a67d
21 changed files with 40 additions and 56 deletions

View File

@@ -9,12 +9,11 @@ struct CwiseClampOp {
CwiseClampOp(const Scalar& inf, const Scalar& sup) : m_inf(inf), m_sup(sup) {}
const Scalar operator()(const Scalar& x) const { return x<m_inf ? m_inf : (x>m_sup ? m_sup : x); }
Scalar m_inf, m_sup;
enum { Cost = Eigen::ConditionalJumpCost + Eigen::NumTraits<Scalar>::AddCost };
};
int main(int, char**)
{
Matrix4d m1 = Matrix4d::random();
cout << m1 << endl << "becomes: " << endl << m1.cwise(CwiseClampOp<double>(-0.5,0.5)) << endl;
cout << m1 << endl << "becomes: " << endl << m1.unaryExpr(CwiseClampOp<double>(-0.5,0.5)) << endl;
return 0;
}