some documentation fixes (Cwise* and Cholesky)

This commit is contained in:
Gael Guennebaud
2008-05-22 16:31:00 +00:00
parent 94e1629a1b
commit 8f1fc80a77
9 changed files with 24 additions and 30 deletions

View File

@@ -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;
}