From 4e299afb1f1f19f470920f63b39c5a91be138788 Mon Sep 17 00:00:00 2001 From: Benoit Jacob Date: Thu, 27 Sep 2007 19:24:57 +0000 Subject: don't enclose eigen in a namespace. prefixing is the way to go. For example Qt uses a prefix and no namespace (except for a few things) --- doc/tutorial.cpp | 1 - src/internal/Block.h | 4 ---- src/internal/EigenBase.h | 4 ---- src/internal/Matrix.h | 5 ----- src/internal/MatrixOps.h | 4 ---- src/internal/MatrixRef.h | 5 ----- src/internal/MatrixStorage.h | 4 ---- src/internal/Minor.h | 4 ---- src/internal/RowAndCol.h | 4 ---- src/internal/ScalarOps.h | 4 ---- src/internal/Util.h | 6 ------ test/main.h | 1 - 12 files changed, 46 deletions(-) diff --git a/doc/tutorial.cpp b/doc/tutorial.cpp index 18a1ced55..2eec7be3e 100644 --- a/doc/tutorial.cpp +++ b/doc/tutorial.cpp @@ -1,7 +1,6 @@ #include "../src/All" using namespace std; -using namespace Eigen; int main(int, char **) { diff --git a/src/internal/Block.h b/src/internal/Block.h index 9be1d165c..72181abb7 100644 --- a/src/internal/Block.h +++ b/src/internal/Block.h @@ -26,8 +26,6 @@ #ifndef EIGEN_BLOCK_H #define EIGEN_BLOCK_H -namespace Eigen { - template class MatrixBlock : public EigenBase > { @@ -83,6 +81,4 @@ EigenBase::block(int startRow, int endRow, int startCol, int en return MatrixBlock(ref(), startRow, endRow, startCol, endCol); } -} // namespace Eigen - #endif // EIGEN_BLOCK_H diff --git a/src/internal/EigenBase.h b/src/internal/EigenBase.h index 804880c75..ad39df599 100644 --- a/src/internal/EigenBase.h +++ b/src/internal/EigenBase.h @@ -28,8 +28,6 @@ #include "Util.h" -namespace Eigen { - template class EigenBase { static const int RowsAtCompileTime = Derived::RowsAtCompileTime, @@ -129,6 +127,4 @@ std::ostream & operator << return s; } -} // namespace Eigen - #endif // EIGEN_EIGENBASE_H diff --git a/src/internal/Matrix.h b/src/internal/Matrix.h index e7ab5e8d8..af397c2eb 100644 --- a/src/internal/Matrix.h +++ b/src/internal/Matrix.h @@ -31,9 +31,6 @@ #include "MatrixRef.h" #include "MatrixStorage.h" -namespace Eigen -{ - template class Matrix : public EigenBase<_Scalar, Matrix<_Scalar, _Rows, _Cols> >, public MatrixStorage<_Scalar, _Rows, _Cols> @@ -129,8 +126,6 @@ EIGEN_MAKE_TYPEDEFS_ALL_SIZES(std::complex, cd) #undef EIGEN_MAKE_TYPEDEFS_ALL_SIZES #undef EIGEN_MAKE_TYPEDEFS -} // namespace Eigen - #include "MatrixOps.h" #include "ScalarOps.h" #include "RowAndCol.h" diff --git a/src/internal/MatrixOps.h b/src/internal/MatrixOps.h index 9fb639fa3..eda1b58b4 100644 --- a/src/internal/MatrixOps.h +++ b/src/internal/MatrixOps.h @@ -26,8 +26,6 @@ #ifndef EIGEN_MATRIXOPS_H #define EIGEN_MATRIXOPS_H -namespace Eigen { - template class MatrixSum : public EigenBase > { @@ -197,6 +195,4 @@ EigenBase::operator*=(const EigenBase &ot return *static_cast(this); } -} // namespace Eigen - #endif // EIGEN_MATRIXOPS_H diff --git a/src/internal/MatrixRef.h b/src/internal/MatrixRef.h index 71545aba3..8ee569001 100644 --- a/src/internal/MatrixRef.h +++ b/src/internal/MatrixRef.h @@ -26,9 +26,6 @@ #ifndef EIGEN_MATRIXREF_H #define EIGEN_MATRIXREF_H -namespace Eigen -{ - template class MatrixRef : public EigenBase > { @@ -60,6 +57,4 @@ template class MatrixRef MatrixType& m_matrix; }; -} // namespace Eigen - #endif // EIGEN_MATRIXREF_H diff --git a/src/internal/MatrixStorage.h b/src/internal/MatrixStorage.h index 8dee4cebf..45afcbe6a 100644 --- a/src/internal/MatrixStorage.h +++ b/src/internal/MatrixStorage.h @@ -26,8 +26,6 @@ #ifndef EIGEN_MATRIXSTORAGE_H #define EIGEN_MATRIXSTORAGE_H -namespace Eigen { - template @@ -125,6 +123,4 @@ class MatrixStorage { delete[] m_array; } }; -} // namespace Eigen - #endif // EIGEN_MATRIXSTORAGE_H diff --git a/src/internal/Minor.h b/src/internal/Minor.h index 627dbf723..20aa7060f 100644 --- a/src/internal/Minor.h +++ b/src/internal/Minor.h @@ -26,8 +26,6 @@ #ifndef EIGEN_MINOR_H #define EIGEN_MINOR_H -namespace Eigen { - template class MatrixMinor : public EigenBase > { @@ -79,6 +77,4 @@ EigenBase::minor(int row, int col) return MatrixMinor(ref(), row, col); } -} // namespace Eigen - #endif // EIGEN_MINOR_H diff --git a/src/internal/RowAndCol.h b/src/internal/RowAndCol.h index b99d70766..5b6e4ef07 100644 --- a/src/internal/RowAndCol.h +++ b/src/internal/RowAndCol.h @@ -26,8 +26,6 @@ #ifndef EIGEN_ROWANDCOL_H #define EIGEN_ROWANDCOL_H -namespace Eigen { - template class MatrixRow : public EigenBase > { @@ -143,6 +141,4 @@ EigenBase::col(int i) return MatrixCol(ref(), i); } -} // namespace Eigen - #endif // EIGEN_ROWANDCOL_H diff --git a/src/internal/ScalarOps.h b/src/internal/ScalarOps.h index fb8e340dc..a28b7e6cb 100644 --- a/src/internal/ScalarOps.h +++ b/src/internal/ScalarOps.h @@ -26,8 +26,6 @@ #ifndef EIGEN_SCALAROPS_H #define EIGEN_SCALAROPS_H -namespace Eigen { - template class ScalarProduct : public EigenBase > { @@ -113,6 +111,4 @@ EIGEN_MAKE_SCALAR_OPS(std::complex) #undef EIGEN_MAKE_SCALAR_OPS -} // namespace Eigen - #endif // EIGEN_SCALAROPS_H diff --git a/src/internal/Util.h b/src/internal/Util.h index 1851bdd6c..179f70ffd 100644 --- a/src/internal/Util.h +++ b/src/internal/Util.h @@ -40,9 +40,6 @@ #define EIGEN_CHECK_COL_RANGE(matrix, col) \ assert(col >= 0 && col < (matrix).cols()) -namespace Eigen -{ - //forward declarations template class Matrix; template class MatrixAlias; @@ -100,7 +97,4 @@ EIGEN_INHERIT_ASSIGNMENT_OPERATOR(Derived, -=) \ EIGEN_INHERIT_SCALAR_ASSIGNMENT_OPERATOR(Derived, *=) \ EIGEN_INHERIT_SCALAR_ASSIGNMENT_OPERATOR(Derived, /=) - -} // namespace Eigen - #endif // EIGEN_UTIL_H diff --git a/test/main.h b/test/main.h index 45cabd369..0ae9967b5 100644 --- a/test/main.h +++ b/test/main.h @@ -33,7 +33,6 @@ #include using namespace std; -using namespace Eigen; class EigenTest : public QObject { -- cgit v1.2.3