diff options
author | Benoit Jacob <jacob.benoit.1@gmail.com> | 2007-10-11 20:14:01 +0000 |
---|---|---|
committer | Benoit Jacob <jacob.benoit.1@gmail.com> | 2007-10-11 20:14:01 +0000 |
commit | 61de15f3610d11e0bbd2eccc02c21e7abb343ac1 (patch) | |
tree | d33eb0fae1fdd6e938df60a068bc79c53b4d0197 /doc/tutorial.cpp | |
parent | 3c98677376fb33f11fe2f786a49bc97b07743711 (diff) |
Democracy 1 - 0 Dictatorship
After huge thread on eigen mailing list, it appears that i'm the
only one in favor of prefix Ei. Everybody else prefers namespace
Eigen like we did in Eigen 1. So, revert.
Also add a macro USING_EIGEN_DATA_TYPES that application programmers
can use to automatically do "using"on the Matrix class and its
matrix/vector typedefs:
using Eigen::Matrix;
using Eigen::Matrix2d;
using Eigen::Vector2d;
... (the list of typedefs is really long).
thanks to the suffixes, the Vector typedefs aren't really polluting.
CCMAIL:eigen@lists.tuxfamily.org
P.S. Danny, please skip this one :) I know you already reported the
namespace->prefix move, now that one would be too much noise :)
Diffstat (limited to 'doc/tutorial.cpp')
-rw-r--r-- | doc/tutorial.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/doc/tutorial.cpp b/doc/tutorial.cpp index ab145bf3f..4400bd2d1 100644 --- a/doc/tutorial.cpp +++ b/doc/tutorial.cpp @@ -1,10 +1,12 @@ #include "../src/Core.h" +USING_EIGEN_DATA_TYPES + using namespace std; int main(int, char **) { - EiMatrix<double,2,2> m; // 2x2 fixed-size matrix with uninitialized entries + Matrix<double,2,2> m; // 2x2 fixed-size matrix with uninitialized entries m(0,0) = 1; m(0,1) = 2; m(1,0) = 3; @@ -12,7 +14,7 @@ int main(int, char **) cout << "Here is a 2x2 matrix m:" << endl << m << endl; cout << "Let us now build a 4x4 matrix m2 by assembling together four 2x2 blocks." << endl; - EiMatrixXd m2(4,4); // dynamic matrix with initial size 4x4 and uninitialized entries + MatrixXd m2(4,4); // dynamic matrix with initial size 4x4 and uninitialized entries // notice how we are mixing fixed-size and dynamic-size types. cout << "In the top-left block, we put the matrix m shown above." << endl; |