From 6f09d3a67d333d68e7c971147ec77600e86e93f3 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Tue, 8 Jul 2008 07:56:01 +0000 Subject: - many updates after Cwise change - fix compilation in product.cpp with std::complex - fix bug in MatrixBase::operator!= --- doc/Mainpage.dox | 6 +++--- doc/echelon.cpp | 4 ++-- doc/examples/class_CwiseBinaryOp.cpp | 3 +-- doc/examples/class_CwiseUnaryOp.cpp | 3 +-- doc/snippets/MatrixBase_map.cpp | 5 ----- doc/snippets/MatrixBase_map_int.cpp | 5 ----- doc/snippets/MatrixBase_map_int_int.cpp | 5 ----- 7 files changed, 7 insertions(+), 24 deletions(-) delete mode 100644 doc/snippets/MatrixBase_map.cpp delete mode 100644 doc/snippets/MatrixBase_map_int.cpp delete mode 100644 doc/snippets/MatrixBase_map_int_int.cpp (limited to 'doc') diff --git a/doc/Mainpage.dox b/doc/Mainpage.dox index ce869371b..2437872b0 100644 --- a/doc/Mainpage.dox +++ b/doc/Mainpage.dox @@ -4,11 +4,11 @@ o /** \mainpage Eigen This is the API documentation for Eigen. -Most of the API is available as methods in MatrixBase, so this is a good starting point for browsing. Also have a look at Matrix, as a few methods and the matrix constructors are there. +Most of the API is available as methods in MatrixBase, so this is a good starting point for browsing. Also have a look at Matrix, as a few methods and the matrix constructors are there. Other notable classes for the Eigen API are Cwise, which contains the methods for doing certain coefficient-wise operations, and Part. -For a first contact with Eigen, it is enough to look at Matrix and MatrixBase. In fact, except for advanced use, the only class that you'll have to explicitly name in your program, i.e. of which you'll explicitly contruct objects, is Matrix. For instance, vectors are handled as a special case of Matrix with one column. +For a first contact with Eigen, it is enough to look at Matrix, MatrixBase, and Cwise. In fact, except for advanced use, the only class that you'll have to explicitly name in your program, i.e. of which you'll explicitly contruct objects, is Matrix. For instance, vectors are handled as a special case of Matrix with one column. Typedefs are provided, e.g. Vector2f is a typedef for Matrix. -The many other classes are typically return types for MatrixBase methods. +Most of the other classes are just return types for MatrixBase methods. */ diff --git a/doc/echelon.cpp b/doc/echelon.cpp index 3c9e58e59..49b719ff2 100644 --- a/doc/echelon.cpp +++ b/doc/echelon.cpp @@ -22,7 +22,7 @@ struct unroll_echelon unroll_echelon::run(m); int rowOfBiggest, colOfBiggest; m.template corner(BottomRight) - .cwiseAbs() + .cwise().abs() .maxCoeff(&rowOfBiggest, &colOfBiggest); m.row(k).swap(m.row(k+rowOfBiggest)); m.col(k).swap(m.col(k+colOfBiggest)); @@ -54,7 +54,7 @@ struct unroll_echelon int rowOfBiggest, colOfBiggest; int cornerRows = m.rows()-k, cornerCols = m.cols()-k; m.corner(BottomRight, cornerRows, cornerCols) - .cwiseAbs() + .cwise().abs() .maxCoeff(&rowOfBiggest, &colOfBiggest); m.row(k).swap(m.row(k+rowOfBiggest)); m.col(k).swap(m.col(k+colOfBiggest)); diff --git a/doc/examples/class_CwiseBinaryOp.cpp b/doc/examples/class_CwiseBinaryOp.cpp index 52d65ab2b..7dc8ef762 100644 --- a/doc/examples/class_CwiseBinaryOp.cpp +++ b/doc/examples/class_CwiseBinaryOp.cpp @@ -7,12 +7,11 @@ using namespace std; template struct MakeComplexOp EIGEN_EMPTY_STRUCT { typedef complex result_type; complex operator()(const Scalar& a, const Scalar& b) const { return complex(a,b); } - enum { Cost = 0 }; }; int main(int, char**) { Matrix4d m1 = Matrix4d::random(), m2 = Matrix4d::random(); - cout << m1.cwise(m2, MakeComplexOp()) << endl; + cout << m1.binaryExpr(m2, MakeComplexOp()) << endl; return 0; } diff --git a/doc/examples/class_CwiseUnaryOp.cpp b/doc/examples/class_CwiseUnaryOp.cpp index 37d121cd8..c4d8fd4ce 100644 --- a/doc/examples/class_CwiseUnaryOp.cpp +++ b/doc/examples/class_CwiseUnaryOp.cpp @@ -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 xm_sup ? m_sup : x); } Scalar m_inf, m_sup; - enum { Cost = Eigen::ConditionalJumpCost + Eigen::NumTraits::AddCost }; }; int main(int, char**) { Matrix4d m1 = Matrix4d::random(); - cout << m1 << endl << "becomes: " << endl << m1.cwise(CwiseClampOp(-0.5,0.5)) << endl; + cout << m1 << endl << "becomes: " << endl << m1.unaryExpr(CwiseClampOp(-0.5,0.5)) << endl; return 0; } diff --git a/doc/snippets/MatrixBase_map.cpp b/doc/snippets/MatrixBase_map.cpp deleted file mode 100644 index 1655c542e..000000000 --- a/doc/snippets/MatrixBase_map.cpp +++ /dev/null @@ -1,5 +0,0 @@ -int data[4] = {1,3,0,2}; -cout << Matrix2i::map(data) << endl; -Matrix2i::map(data) *= 2; -cout << "The data is now:" << endl; -for(int i = 0; i < 4; i++) cout << data[i] << endl; \ No newline at end of file diff --git a/doc/snippets/MatrixBase_map_int.cpp b/doc/snippets/MatrixBase_map_int.cpp deleted file mode 100644 index 066e54773..000000000 --- a/doc/snippets/MatrixBase_map_int.cpp +++ /dev/null @@ -1,5 +0,0 @@ -int data[4] = {1,3,0,2}; -cout << VectorXi::map(data, 4) << endl; -VectorXi::map(data, 4) *= 2; -cout << "The data is now:" << endl; -for(int i = 0; i < 4; i++) cout << data[i] << endl; diff --git a/doc/snippets/MatrixBase_map_int_int.cpp b/doc/snippets/MatrixBase_map_int_int.cpp deleted file mode 100644 index 516b9e7f9..000000000 --- a/doc/snippets/MatrixBase_map_int_int.cpp +++ /dev/null @@ -1,5 +0,0 @@ -int data[4] = {1,3,0,2}; -cout << MatrixXi::map(data, 2, 2) << endl; -MatrixXi::map(data, 2, 2) *= 2; -cout << "The data is now:" << endl; -for(int i = 0; i < 4; i++) cout << data[i] << endl; -- cgit v1.2.3