diff options
author | Gael Guennebaud <g.gael@free.fr> | 2008-05-22 16:31:00 +0000 |
---|---|---|
committer | Gael Guennebaud <g.gael@free.fr> | 2008-05-22 16:31:00 +0000 |
commit | 8f1fc80a77551b26c05669527534aff7b621b86c (patch) | |
tree | 145a82470e1193e7c25492925f10dcbe34221dd6 /doc/examples/class_CwiseUnaryOp.cpp | |
parent | 94e1629a1b64e384281514b3c11e4c74ca31a622 (diff) |
some documentation fixes (Cwise* and Cholesky)
Diffstat (limited to 'doc/examples/class_CwiseUnaryOp.cpp')
-rw-r--r-- | doc/examples/class_CwiseUnaryOp.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/doc/examples/class_CwiseUnaryOp.cpp b/doc/examples/class_CwiseUnaryOp.cpp index ea27876eb..4111b7eec 100644 --- a/doc/examples/class_CwiseUnaryOp.cpp +++ b/doc/examples/class_CwiseUnaryOp.cpp @@ -2,9 +2,9 @@ USING_PART_OF_NAMESPACE_EIGEN using namespace std; -// define a custom template binary functor +// define a custom template unary functor template<typename Scalar> -struct CwiseClampOp EIGEN_EMPTY_STRUCT { +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; @@ -14,6 +14,6 @@ struct CwiseClampOp EIGEN_EMPTY_STRUCT { int main(int, char**) { Matrix4d m1 = Matrix4d::random(); - cout << m1.cwise(CwiseClampOp<double>(-0.5,0.5)) << endl; + cout << m1 << endl << "becomes: " << endl << m1.cwise(CwiseClampOp<double>(-0.5,0.5)) << endl; return 0; } |