aboutsummaryrefslogtreecommitdiffhomepage
path: root/doc
diff options
context:
space:
mode:
authorGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2010-04-22 18:27:13 -0400
committerGravatar Benoit Jacob <jacob.benoit.1@gmail.com>2010-04-22 18:27:13 -0400
commitabbe260905e96b9323cb5cf4ab9189a3292bf585 (patch)
treec7cbdc9c11813046e73df5362db3034276b6d1a6 /doc
parentef789fe0d2bc20e5743a82c39a1232ac1a78b486 (diff)
remove USING_PART_OF_NAMESPACE_EIGEN, leaving it in Eigen2Support.
improve porting-Eigen2-to-3 docs
Diffstat (limited to 'doc')
-rw-r--r--doc/A05_PortingFrom2To3.dox114
-rw-r--r--doc/example.cpp26
-rw-r--r--doc/examples/Tutorial_simple_example_dynamic_size.cpp3
-rw-r--r--doc/examples/Tutorial_simple_example_fixed_size.cpp3
-rw-r--r--doc/examples/class_Block.cpp2
-rw-r--r--doc/examples/class_CwiseBinaryOp.cpp2
-rw-r--r--doc/examples/class_CwiseUnaryOp.cpp2
-rw-r--r--doc/examples/class_FixedBlock.cpp2
-rw-r--r--doc/examples/class_FixedVectorBlock.cpp2
-rw-r--r--doc/examples/class_VectorBlock.cpp2
10 files changed, 74 insertions, 84 deletions
diff --git a/doc/A05_PortingFrom2To3.dox b/doc/A05_PortingFrom2To3.dox
index 554ca7f2c..d1acb055f 100644
--- a/doc/A05_PortingFrom2To3.dox
+++ b/doc/A05_PortingFrom2To3.dox
@@ -7,36 +7,74 @@ and to help porting an application from Eigen2 to Eigen3.
\b Table \b of \b contents
- \ref CompatibilitySupport
- - \ref ChangeList
+ - \ref VectorBlocks
+ - \ref TriangularViews
+ - \ref TriangularSolveInPlace
+ - \ref Using
- \ref CoefficientWiseOperations
- \ref Corners
- \ref LazyVsNoalias
\section CompatibilitySupport Eigen2 compatibility support
-In order to ease the switch from Eigen2 to Eigen3, Eigen3 features a compatibility mode which can be enabled by defining the EIGEN2_SUPPORT preprocessor token \b before including any Eigen's header (typically it should be set in your project options).
+In order to ease the switch from Eigen2 to Eigen3, Eigen3 features a compatibility mode which can be enabled by defining the EIGEN2_SUPPORT preprocessor token \b before including any Eigen header (typically it should be set in your project options).
-\section ChangeList List of changes in the API
+\section VectorBlocks Vector blocks
<table>
-<tr><td>Eigen 2</td><td>Eigen 3</td><td>Comments</td></tr>
+<tr><td>Eigen 2</td><td>Eigen 3</td></tr>
<tr><td>\code
-vec.start(length)
-vec.start<length>()
-vec.end(length)
-vec.end<length>()
+vector.start(length)
+vector.start<length>()
+vector.end(length)
+vector.end<length>()
\endcode</td><td>\code
-vec.head(length)
-vec.head<length>()
-vec.tail(length)
-vec.tail<length>()
-\endcode</td><td>Trivial "search and replace".</td></tr>
-<tr><td colspan="3"></td></tr>
-<tr><td>\code mat.cwise().XXX()\endcode</td><td>\code mat.array().XXX()\endcode</td><td>See \ref CoefficientWiseOperations. </td></tr>
-<tr><td colspan="3"></td></tr>
-<tr><td>\code c = (a * b).lazy();\endcode</td><td>\code c.noalias() = a * b;\endcode</td><td>See \ref LazyVsNoalias. </td></tr>
-<tr><td colspan="3"></td></tr>
-<tr><td>\code A.triangularSolveInPlace<XXX>(X);\endcode</td><td>\code A.triangularView<XXX>().solveInPlace(X);\endcode</td><td></td></tr>
+vector.head(length)
+vector.head<length>()
+vector.tail(length)
+vector.tail<length>()
+\endcode</td></tr>
+</table>
+
+
+\section Corners Matrix Corners
+
+<table>
+<tr><td>Eigen 2</td><td>Eigen 3</td></tr>
+<tr><td>\code
+matrix.corner(TopLeft,r,c)
+matrix.corner(TopRight,r,c)
+matrix.corner(BottomLeft,r,c)
+matrix.corner(BottomRight,r,c)
+matrix.corner<r,c>(TopLeft)
+matrix.corner<r,c>(TopRight)
+matrix.corner<r,c>(BottomLeft)
+matrix.corner<r,c>(BottomRight)
+\endcode</td><td>\code
+matrix.topLeftCorner(r,c)
+matrix.topRightCorner(r,c)
+matrix.bottomLeftCorner(r,c)
+matrix.bottomRightCorner(r,c)
+matrix.topLeftCorner<r,c>()
+matrix.topRightCorner<r,c>()
+matrix.bottomLeftCorner<r,c>()
+matrix.bottomRightCorner<r,c>()
+\endcode</td>
+</tr>
+</table>
+
+Notice that Eigen3 also provides these new convenience methods: topRows(), bottomRows(), leftCols(), rightCols(). See in class DenseBase.
+
+
+\section TriangularViews Triangular views
+
+TODO: fill this section
+
+\section TriangularSolveInPlace Triangular in-place solving
+
+<table>
+<tr><td>Eigen 2</td><td>Eigen 3</td></tr>
+<tr><td>\code A.triangularSolveInPlace<XXX>(X);\endcode</td><td>\code A.triangularView<XXX>().solveInPlace(X);\endcode</td></tr>
<tr><td colspan="3"></td></tr>
<tr><td>\code
UpperTriangular
@@ -53,9 +91,17 @@ UnitLower
StrictlyUpper
StrictlyLower
\endcode</td>
-<td>Trivial "search and replace".</td></tr>
+</tr>
</table>
+\section Using The USING_PART_OF_NAMESPACE_EIGEN macro
+
+The USING_PART_OF_NAMESPACE_EIGEN macro has been removed. In Eigen 3, just do:
+\code
+using namespace Eigen;
+\endcode
+
+
\section CoefficientWiseOperations Coefficient wise operations
In Eigen2, coefficient wise operations which have no proper mathematical definition (as a coefficient wise product)
@@ -82,34 +128,6 @@ With Eigen2 you would have written:
c = (a.cwise().abs().cwise().pow(3)).cwise() * (b.cwise().abs().cwise().sin());
\endcode
-\section Corners Corners
-
-<table>
-<tr><td>Eigen 2</td><td>Eigen 3</td></tr>
-<tr><td>\code
-matrix.corner(TopLeft,r,c)
-matrix.corner(TopRight,r,c)
-matrix.corner(BottomLeft,r,c)
-matrix.corner(BottomRight,r,c)
-matrix.corner<r,c>(TopLeft)
-matrix.corner<r,c>(TopRight)
-matrix.corner<r,c>(BottomLeft)
-matrix.corner<r,c>(BottomRight)
-\endcode</td><td>\code
-matrix.topLeftCorner(r,c)
-matrix.topRightCorner(r,c)
-matrix.bottomLeftCorner(r,c)
-matrix.bottomRightCorner(r,c)
-matrix.topLeftCorner<r,c>()
-matrix.topRightCorner<r,c>()
-matrix.bottomLeftCorner<r,c>()
-matrix.bottomRightCorner<r,c>()
-\endcode</td>
-</tr>
-</table>
-
-Notice that Eigen3 also provides these new convenience methods: topRows(), bottomRows(), leftCols(), rightCols(). See in class DenseBase.
-
\section LazyVsNoalias Lazy evaluation and noalias
In Eigen all operations are performed in a lazy fashion except the matrix products which are always evaluated into a temporary by default.
diff --git a/doc/example.cpp b/doc/example.cpp
deleted file mode 100644
index 23893488a..000000000
--- a/doc/example.cpp
+++ /dev/null
@@ -1,26 +0,0 @@
-#include <Eigen/Core>
-
-USING_PART_OF_NAMESPACE_EIGEN
-
-using namespace std;
-
-template<typename Scalar, typename Derived>
-void foo(const MatrixBase<Scalar, Derived>& m)
-{
- cout << "Here's m:" << endl << m << endl;
-}
-
-template<typename Scalar, typename Derived>
-Eigen::ScalarMultiple<Derived>
-twice(const MatrixBase<Scalar, Derived>& m)
-{
- return 2 * m;
-}
-
-int main(int, char**)
-{
- Matrix2d m = Matrix2d::random();
- foo(m);
- foo(twice(m));
- return 0;
-}
diff --git a/doc/examples/Tutorial_simple_example_dynamic_size.cpp b/doc/examples/Tutorial_simple_example_dynamic_size.cpp
index 9a0e2c3d8..d780e7326 100644
--- a/doc/examples/Tutorial_simple_example_dynamic_size.cpp
+++ b/doc/examples/Tutorial_simple_example_dynamic_size.cpp
@@ -1,8 +1,7 @@
#include <Eigen/Core>
#include <iostream>
-// import most common Eigen types
-USING_PART_OF_NAMESPACE_EIGEN
+using namespace Eigen;
int main(int, char *[])
{
diff --git a/doc/examples/Tutorial_simple_example_fixed_size.cpp b/doc/examples/Tutorial_simple_example_fixed_size.cpp
index 586be863d..a5c856732 100644
--- a/doc/examples/Tutorial_simple_example_fixed_size.cpp
+++ b/doc/examples/Tutorial_simple_example_fixed_size.cpp
@@ -1,8 +1,7 @@
#include <Eigen/Core>
#include <iostream>
-// import most common Eigen types
-USING_PART_OF_NAMESPACE_EIGEN
+using namespace Eigen;
int main(int, char *[])
{
diff --git a/doc/examples/class_Block.cpp b/doc/examples/class_Block.cpp
index a8e0c85a1..c6144cef5 100644
--- a/doc/examples/class_Block.cpp
+++ b/doc/examples/class_Block.cpp
@@ -1,6 +1,6 @@
#include <Eigen/Core>
#include <iostream>
-USING_PART_OF_NAMESPACE_EIGEN
+using namespace Eigen;
using namespace std;
template<typename Derived>
diff --git a/doc/examples/class_CwiseBinaryOp.cpp b/doc/examples/class_CwiseBinaryOp.cpp
index d26e65f23..682af46de 100644
--- a/doc/examples/class_CwiseBinaryOp.cpp
+++ b/doc/examples/class_CwiseBinaryOp.cpp
@@ -1,6 +1,6 @@
#include <Eigen/Core>
#include <iostream>
-USING_PART_OF_NAMESPACE_EIGEN
+using namespace Eigen;
using namespace std;
// define a custom template binary functor
diff --git a/doc/examples/class_CwiseUnaryOp.cpp b/doc/examples/class_CwiseUnaryOp.cpp
index 9e22bf095..a5fcc153d 100644
--- a/doc/examples/class_CwiseUnaryOp.cpp
+++ b/doc/examples/class_CwiseUnaryOp.cpp
@@ -1,6 +1,6 @@
#include <Eigen/Core>
#include <iostream>
-USING_PART_OF_NAMESPACE_EIGEN
+using namespace Eigen;
using namespace std;
// define a custom template unary functor
diff --git a/doc/examples/class_FixedBlock.cpp b/doc/examples/class_FixedBlock.cpp
index 3961119e1..5e0e53da3 100644
--- a/doc/examples/class_FixedBlock.cpp
+++ b/doc/examples/class_FixedBlock.cpp
@@ -1,6 +1,6 @@
#include <Eigen/Core>
#include <iostream>
-USING_PART_OF_NAMESPACE_EIGEN
+using namespace Eigen;
using namespace std;
template<typename Derived>
diff --git a/doc/examples/class_FixedVectorBlock.cpp b/doc/examples/class_FixedVectorBlock.cpp
index 917d465ab..9be7d8d71 100644
--- a/doc/examples/class_FixedVectorBlock.cpp
+++ b/doc/examples/class_FixedVectorBlock.cpp
@@ -1,6 +1,6 @@
#include <Eigen/Core>
#include <iostream>
-USING_PART_OF_NAMESPACE_EIGEN
+using namespace Eigen;
using namespace std;
template<typename Derived>
diff --git a/doc/examples/class_VectorBlock.cpp b/doc/examples/class_VectorBlock.cpp
index 2848bc1ea..2f02c8f69 100644
--- a/doc/examples/class_VectorBlock.cpp
+++ b/doc/examples/class_VectorBlock.cpp
@@ -1,6 +1,6 @@
#include <Eigen/Core>
#include <iostream>
-USING_PART_OF_NAMESPACE_EIGEN
+using namespace Eigen;
using namespace std;
template<typename Derived>