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/example.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/example.cpp')
-rw-r--r-- | doc/example.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/doc/example.cpp b/doc/example.cpp index 75d47f988..ca10d077a 100644 --- a/doc/example.cpp +++ b/doc/example.cpp @@ -1,23 +1,25 @@ #include "../src/Core.h" +USING_EIGEN_DATA_TYPES + using namespace std; template<typename Scalar, typename Derived> -void foo(const EiObject<Scalar, Derived>& m) +void foo(const Eigen::Object<Scalar, Derived>& m) { cout << "Here's m:" << endl << m << endl; } template<typename Scalar, typename Derived> -EiScalarProduct<Derived> -twice(const EiObject<Scalar, Derived>& m) +Eigen::ScalarProduct<Derived> +twice(const Eigen::Object<Scalar, Derived>& m) { return 2 * m; } int main(int, char**) { - EiMatrix2d m; + Matrix2d m; m(0,0)= 1; m(1,0)= 2; m(0,1)= 3; |