Get rid of include directives inside namespace blocks (bug #339).
diff --git a/unsupported/Eigen/src/BVH/BVAlgorithms.h b/unsupported/Eigen/src/BVH/BVAlgorithms.h
index d65a977..6cba656 100644
--- a/unsupported/Eigen/src/BVH/BVAlgorithms.h
+++ b/unsupported/Eigen/src/BVH/BVAlgorithms.h
@@ -25,6 +25,8 @@
 #ifndef EIGEN_BVALGORITHMS_H
 #define EIGEN_BVALGORITHMS_H
 
+namespace Eigen { 
+
 namespace internal {
 
 #ifndef EIGEN_PARSED_BY_DOXYGEN
@@ -301,4 +303,6 @@
   return minimum;
 }
 
+} // end namespace Eigen
+
 #endif // EIGEN_BVALGORITHMS_H
diff --git a/unsupported/Eigen/src/BVH/KdBVH.h b/unsupported/Eigen/src/BVH/KdBVH.h
index 028b481..a0f6660 100644
--- a/unsupported/Eigen/src/BVH/KdBVH.h
+++ b/unsupported/Eigen/src/BVH/KdBVH.h
@@ -25,6 +25,8 @@
 #ifndef KDBVH_H_INCLUDED
 #define KDBVH_H_INCLUDED
 
+namespace Eigen { 
+
 namespace internal {
 
 //internal pair class for the BVH--used instead of std::pair because of alignment
@@ -230,4 +232,6 @@
   ObjectList objects;
 };
 
+} // end namespace Eigen
+
 #endif //KDBVH_H_INCLUDED
diff --git a/unsupported/Eigen/src/FFT/ei_fftw_impl.h b/unsupported/Eigen/src/FFT/ei_fftw_impl.h
index a06f673..5c36db7 100644
--- a/unsupported/Eigen/src/FFT/ei_fftw_impl.h
+++ b/unsupported/Eigen/src/FFT/ei_fftw_impl.h
@@ -22,6 +22,8 @@
 // License and a copy of the GNU General Public License along with
 // Eigen. If not, see <http://www.gnu.org/licenses/>.
 
+namespace Eigen { 
+
 namespace internal {
 
   // FFTW uses non-const arguments
@@ -269,4 +271,6 @@
 
 } // end namespace internal
 
+} // end namespace Eigen
+
 /* vim: set filetype=cpp et sw=2 ts=2 ai: */
diff --git a/unsupported/Eigen/src/FFT/ei_kissfft_impl.h b/unsupported/Eigen/src/FFT/ei_kissfft_impl.h
index 04b98b0..c3cbb7f 100644
--- a/unsupported/Eigen/src/FFT/ei_kissfft_impl.h
+++ b/unsupported/Eigen/src/FFT/ei_kissfft_impl.h
@@ -22,6 +22,8 @@
 // License and a copy of the GNU General Public License along with
 // Eigen. If not, see <http://www.gnu.org/licenses/>.
 
+namespace Eigen { 
+
 namespace internal {
 
   // This FFT implementation was derived from kissfft http:sourceforge.net/projects/kissfft
@@ -426,5 +428,6 @@
 
 } // end namespace internal
 
-/* vim: set filetype=cpp et sw=2 ts=2 ai: */
+} // end namespace Eigen
 
+/* vim: set filetype=cpp et sw=2 ts=2 ai: */
diff --git a/unsupported/Eigen/src/IterativeSolvers/ConstrainedConjGrad.h b/unsupported/Eigen/src/IterativeSolvers/ConstrainedConjGrad.h
index 4d8e183..f8a5505 100644
--- a/unsupported/Eigen/src/IterativeSolvers/ConstrainedConjGrad.h
+++ b/unsupported/Eigen/src/IterativeSolvers/ConstrainedConjGrad.h
@@ -50,6 +50,8 @@
 
 #include <Eigen/Core>
 
+namespace Eigen { 
+
 namespace internal {
 
 /** \ingroup IterativeSolvers_Module
@@ -195,4 +197,6 @@
 
 } // end namespace internal
 
+} // end namespace Eigen
+
 #endif // EIGEN_CONSTRAINEDCG_H
diff --git a/unsupported/Eigen/src/IterativeSolvers/GMRES.h b/unsupported/Eigen/src/IterativeSolvers/GMRES.h
index 9bebae9..3b74e44 100644
--- a/unsupported/Eigen/src/IterativeSolvers/GMRES.h
+++ b/unsupported/Eigen/src/IterativeSolvers/GMRES.h
@@ -26,6 +26,8 @@
 #ifndef EIGEN_GMRES_H
 #define EIGEN_GMRES_H
 
+namespace Eigen { 
+
 namespace internal {
 
 /**
@@ -385,6 +387,8 @@
   }
 };
 
-}
+} // end namespace internal
+
+} // end namespace Eigen
 
 #endif // EIGEN_GMRES_H
diff --git a/unsupported/Eigen/src/IterativeSolvers/IncompleteLU.h b/unsupported/Eigen/src/IterativeSolvers/IncompleteLU.h
index d8d4469..e02f1f0 100644
--- a/unsupported/Eigen/src/IterativeSolvers/IncompleteLU.h
+++ b/unsupported/Eigen/src/IterativeSolvers/IncompleteLU.h
@@ -25,6 +25,8 @@
 #ifndef EIGEN_INCOMPLETE_LU_H
 #define EIGEN_INCOMPLETE_LU_H
 
+namespace Eigen { 
+
 template <typename _Scalar>
 class IncompleteLU
 {
@@ -119,6 +121,8 @@
   }
 };
 
-}
+} // end namespace internal
+
+} // end namespace Eigen
 
 #endif // EIGEN_INCOMPLETE_LU_H
diff --git a/unsupported/Eigen/src/IterativeSolvers/IterationController.h b/unsupported/Eigen/src/IterativeSolvers/IterationController.h
index a65793c..dfb97e2 100644
--- a/unsupported/Eigen/src/IterativeSolvers/IterationController.h
+++ b/unsupported/Eigen/src/IterativeSolvers/IterationController.h
@@ -75,6 +75,8 @@
 #ifndef EIGEN_ITERATION_CONTROLLER_H
 #define EIGEN_ITERATION_CONTROLLER_H
 
+namespace Eigen { 
+
 /** \ingroup IterativeSolvers_Module
   * \class IterationController
   *
@@ -163,4 +165,6 @@
 
 };
 
+} // end namespace Eigen
+
 #endif // EIGEN_ITERATION_CONTROLLER_H
diff --git a/unsupported/Eigen/src/KroneckerProduct/KroneckerTensorProduct.h b/unsupported/Eigen/src/KroneckerProduct/KroneckerTensorProduct.h
index cc5f271..4627705 100644
--- a/unsupported/Eigen/src/KroneckerProduct/KroneckerTensorProduct.h
+++ b/unsupported/Eigen/src/KroneckerProduct/KroneckerTensorProduct.h
@@ -28,6 +28,8 @@
 #define KRONECKER_TENSOR_PRODUCT_H
 
 
+namespace Eigen { 
+
 namespace internal {
 
 /*!
@@ -165,4 +167,6 @@
   internal::kroneckerProduct_sparse(a.derived(), b.derived(), c.derived());
 }
 
+} // end namespace Eigen
+
 #endif // KRONECKER_TENSOR_PRODUCT_H
diff --git a/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h b/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h
index c9aeb33..6cdd657 100644
--- a/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h
+++ b/unsupported/Eigen/src/MatrixFunctions/MatrixExponential.h
@@ -28,6 +28,8 @@
 
 #include "StemFunction.h"
 
+namespace Eigen { 
+
 #if defined(_MSC_VER) || defined(__FreeBSD__)
   template <typename Scalar> Scalar log2(Scalar v) { using std::log; return log(v)/log(Scalar(2)); }
 #endif
@@ -462,4 +464,6 @@
   return MatrixExponentialReturnValue<Derived>(derived());
 }
 
+} // end namespace Eigen
+
 #endif // EIGEN_MATRIX_EXPONENTIAL
diff --git a/unsupported/Eigen/src/MatrixFunctions/MatrixFunction.h b/unsupported/Eigen/src/MatrixFunctions/MatrixFunction.h
index 6970b3a..859de72 100644
--- a/unsupported/Eigen/src/MatrixFunctions/MatrixFunction.h
+++ b/unsupported/Eigen/src/MatrixFunctions/MatrixFunction.h
@@ -29,6 +29,8 @@
 #include "MatrixFunctionAtomic.h"
 
 
+namespace Eigen { 
+
 /** \ingroup MatrixFunctions_Module
   * \brief Class for computing matrix functions.
   * \tparam  MatrixType  type of the argument of the matrix function,
@@ -598,4 +600,6 @@
   return MatrixFunctionReturnValue<Derived>(derived(), StdStemFunctions<ComplexScalar>::cosh);
 }
 
+} // end namespace Eigen
+
 #endif // EIGEN_MATRIX_FUNCTION
diff --git a/unsupported/Eigen/src/MatrixFunctions/MatrixFunctionAtomic.h b/unsupported/Eigen/src/MatrixFunctions/MatrixFunctionAtomic.h
index d087669..97ab662 100644
--- a/unsupported/Eigen/src/MatrixFunctions/MatrixFunctionAtomic.h
+++ b/unsupported/Eigen/src/MatrixFunctions/MatrixFunctionAtomic.h
@@ -25,6 +25,8 @@
 #ifndef EIGEN_MATRIX_FUNCTION_ATOMIC
 #define EIGEN_MATRIX_FUNCTION_ATOMIC
 
+namespace Eigen { 
+
 /** \ingroup MatrixFunctions_Module
   * \class MatrixFunctionAtomic
   * \brief Helper class for computing matrix functions of atomic matrices.
@@ -139,4 +141,6 @@
   return false;
 }
 
+} // end namespace Eigen
+
 #endif // EIGEN_MATRIX_FUNCTION_ATOMIC
diff --git a/unsupported/Eigen/src/MatrixFunctions/MatrixLogarithm.h b/unsupported/Eigen/src/MatrixFunctions/MatrixLogarithm.h
index e575be0..4a40d6a 100644
--- a/unsupported/Eigen/src/MatrixFunctions/MatrixLogarithm.h
+++ b/unsupported/Eigen/src/MatrixFunctions/MatrixLogarithm.h
@@ -30,6 +30,8 @@
 #define M_PI 3.141592653589793238462643383279503L
 #endif
 
+namespace Eigen { 
+
 /** \ingroup MatrixFunctions_Module
   * \class MatrixLogarithmAtomic
   * \brief Helper class for computing matrix logarithm of atomic matrices.
@@ -503,4 +505,6 @@
   return MatrixLogarithmReturnValue<Derived>(derived());
 }
 
+} // end namespace Eigen
+
 #endif // EIGEN_MATRIX_LOGARITHM
diff --git a/unsupported/Eigen/src/MatrixFunctions/MatrixSquareRoot.h b/unsupported/Eigen/src/MatrixFunctions/MatrixSquareRoot.h
index ed1b5ee..658cd33 100644
--- a/unsupported/Eigen/src/MatrixFunctions/MatrixSquareRoot.h
+++ b/unsupported/Eigen/src/MatrixFunctions/MatrixSquareRoot.h
@@ -25,6 +25,8 @@
 #ifndef EIGEN_MATRIX_SQUARE_ROOT
 #define EIGEN_MATRIX_SQUARE_ROOT
 
+namespace Eigen { 
+
 /** \ingroup MatrixFunctions_Module
   * \brief Class for computing matrix square roots of upper quasi-triangular matrices.
   * \tparam  MatrixType  type of the argument of the matrix square root,
@@ -492,4 +494,6 @@
   return MatrixSquareRootReturnValue<Derived>(derived());
 }
 
+} // end namespace Eigen
+
 #endif // EIGEN_MATRIX_FUNCTION
diff --git a/unsupported/Eigen/src/MatrixFunctions/StemFunction.h b/unsupported/Eigen/src/MatrixFunctions/StemFunction.h
index 260690b..3de68ec 100644
--- a/unsupported/Eigen/src/MatrixFunctions/StemFunction.h
+++ b/unsupported/Eigen/src/MatrixFunctions/StemFunction.h
@@ -25,6 +25,8 @@
 #ifndef EIGEN_STEM_FUNCTION
 #define EIGEN_STEM_FUNCTION
 
+namespace Eigen { 
+
 /** \ingroup MatrixFunctions_Module 
   * \brief Stem functions corresponding to standard mathematical functions.
   */
@@ -113,4 +115,6 @@
 
 }; // end of class StdStemFunctions
 
+} // end namespace Eigen
+
 #endif // EIGEN_STEM_FUNCTION
diff --git a/unsupported/Eigen/src/MoreVectorization/MathFunctions.h b/unsupported/Eigen/src/MoreVectorization/MathFunctions.h
index bc948d0..123f401 100644
--- a/unsupported/Eigen/src/MoreVectorization/MathFunctions.h
+++ b/unsupported/Eigen/src/MoreVectorization/MathFunctions.h
@@ -26,6 +26,8 @@
 #ifndef EIGEN_MOREVECTORIZATION_MATHFUNCTIONS_H
 #define EIGEN_MOREVECTORIZATION_MATHFUNCTIONS_H
 
+namespace Eigen { 
+
 namespace internal {
 
 /** \internal \returns the arcsin of \a a (coeff-wise) */
@@ -99,8 +101,10 @@
   return _mm_xor_ps(z, sign_bit);
 }
 
+#endif // EIGEN_VECTORIZE_SSE
+
 } // end namespace internal
 
-#endif
+} // end namespace Eigen
 
 #endif // EIGEN_MOREVECTORIZATION_MATHFUNCTIONS_H
diff --git a/unsupported/Eigen/src/NonLinearOptimization/HybridNonLinearSolver.h b/unsupported/Eigen/src/NonLinearOptimization/HybridNonLinearSolver.h
index 37abb61..aa94303 100644
--- a/unsupported/Eigen/src/NonLinearOptimization/HybridNonLinearSolver.h
+++ b/unsupported/Eigen/src/NonLinearOptimization/HybridNonLinearSolver.h
@@ -28,6 +28,8 @@
 #ifndef EIGEN_HYBRIDNONLINEARSOLVER_H
 #define EIGEN_HYBRIDNONLINEARSOLVER_H
 
+namespace Eigen { 
+
 namespace HybridNonLinearSolverSpace { 
     enum Status {
         Running = -1,
@@ -602,6 +604,8 @@
     return status;
 }
 
-//vim: ai ts=4 sts=4 et sw=4
+} // end namespace Eigen
+
 #endif // EIGEN_HYBRIDNONLINEARSOLVER_H
 
+//vim: ai ts=4 sts=4 et sw=4
diff --git a/unsupported/Eigen/src/NonLinearOptimization/LevenbergMarquardt.h b/unsupported/Eigen/src/NonLinearOptimization/LevenbergMarquardt.h
index 0ae681b..2fc50fb 100644
--- a/unsupported/Eigen/src/NonLinearOptimization/LevenbergMarquardt.h
+++ b/unsupported/Eigen/src/NonLinearOptimization/LevenbergMarquardt.h
@@ -28,6 +28,7 @@
 #ifndef EIGEN_LEVENBERGMARQUARDT__H
 #define EIGEN_LEVENBERGMARQUARDT__H
 
+namespace Eigen { 
 
 namespace LevenbergMarquardtSpace {
     enum Status {
@@ -651,6 +652,8 @@
     return info;
 }
 
-//vim: ai ts=4 sts=4 et sw=4
+} // end namespace Eigen
+
 #endif // EIGEN_LEVENBERGMARQUARDT__H
 
+//vim: ai ts=4 sts=4 et sw=4
diff --git a/unsupported/Eigen/src/NonLinearOptimization/chkder.h b/unsupported/Eigen/src/NonLinearOptimization/chkder.h
index bc0cb18..fd3e0bc 100644
--- a/unsupported/Eigen/src/NonLinearOptimization/chkder.h
+++ b/unsupported/Eigen/src/NonLinearOptimization/chkder.h
@@ -2,6 +2,8 @@
 #define chkder_log10e 0.43429448190325182765
 #define chkder_factor 100.
 
+namespace Eigen { 
+
 namespace internal {
 
 template<typename Scalar>
@@ -58,3 +60,4 @@
 
 } // end namespace internal
 
+} // end namespace Eigen
diff --git a/unsupported/Eigen/src/NonLinearOptimization/covar.h b/unsupported/Eigen/src/NonLinearOptimization/covar.h
index 6c77916..c73a096 100644
--- a/unsupported/Eigen/src/NonLinearOptimization/covar.h
+++ b/unsupported/Eigen/src/NonLinearOptimization/covar.h
@@ -1,3 +1,5 @@
+namespace Eigen { 
+
 namespace internal {
 
 template <typename Scalar>
@@ -63,3 +65,5 @@
 }
 
 } // end namespace internal
+
+} // end namespace Eigen
diff --git a/unsupported/Eigen/src/NonLinearOptimization/dogleg.h b/unsupported/Eigen/src/NonLinearOptimization/dogleg.h
index cbdcf4b..4fbc98b 100644
--- a/unsupported/Eigen/src/NonLinearOptimization/dogleg.h
+++ b/unsupported/Eigen/src/NonLinearOptimization/dogleg.h
@@ -1,3 +1,5 @@
+namespace Eigen { 
+
 namespace internal {
 
 template <typename Scalar>
@@ -98,3 +100,5 @@
 }
 
 } // end namespace internal
+
+} // end namespace Eigen
diff --git a/unsupported/Eigen/src/NonLinearOptimization/fdjac1.h b/unsupported/Eigen/src/NonLinearOptimization/fdjac1.h
index 0a26c20..1cabe69 100644
--- a/unsupported/Eigen/src/NonLinearOptimization/fdjac1.h
+++ b/unsupported/Eigen/src/NonLinearOptimization/fdjac1.h
@@ -1,3 +1,5 @@
+namespace Eigen { 
+
 namespace internal {
 
 template<typename FunctorType, typename Scalar>
@@ -70,3 +72,5 @@
 }
 
 } // end namespace internal
+
+} // end namespace Eigen
diff --git a/unsupported/Eigen/src/NonLinearOptimization/lmpar.h b/unsupported/Eigen/src/NonLinearOptimization/lmpar.h
index 62f4aab..cc1ca53 100644
--- a/unsupported/Eigen/src/NonLinearOptimization/lmpar.h
+++ b/unsupported/Eigen/src/NonLinearOptimization/lmpar.h
@@ -1,3 +1,5 @@
+namespace Eigen { 
+
 namespace internal {
 
 template <typename Scalar>
@@ -288,3 +290,5 @@
 }
 
 } // end namespace internal
+
+} // end namespace Eigen
diff --git a/unsupported/Eigen/src/NonLinearOptimization/qrsolv.h b/unsupported/Eigen/src/NonLinearOptimization/qrsolv.h
index cb1764a..feafd62 100644
--- a/unsupported/Eigen/src/NonLinearOptimization/qrsolv.h
+++ b/unsupported/Eigen/src/NonLinearOptimization/qrsolv.h
@@ -1,3 +1,5 @@
+namespace Eigen { 
+
 namespace internal {
 
 // TODO : once qrsolv2 is removed, use ColPivHouseholderQR or PermutationMatrix instead of ipvt
@@ -85,3 +87,5 @@
 }
 
 } // end namespace internal
+
+} // end namespace Eigen
diff --git a/unsupported/Eigen/src/NonLinearOptimization/r1mpyq.h b/unsupported/Eigen/src/NonLinearOptimization/r1mpyq.h
index ffe505c..36ff700 100644
--- a/unsupported/Eigen/src/NonLinearOptimization/r1mpyq.h
+++ b/unsupported/Eigen/src/NonLinearOptimization/r1mpyq.h
@@ -1,3 +1,5 @@
+namespace Eigen { 
+
 namespace internal {
 
 // TODO : move this to GivensQR once there's such a thing in Eigen
@@ -24,3 +26,5 @@
 }
 
 } // end namespace internal
+
+} // end namespace Eigen
diff --git a/unsupported/Eigen/src/NonLinearOptimization/r1updt.h b/unsupported/Eigen/src/NonLinearOptimization/r1updt.h
index 528f8ee..55fae5a 100644
--- a/unsupported/Eigen/src/NonLinearOptimization/r1updt.h
+++ b/unsupported/Eigen/src/NonLinearOptimization/r1updt.h
@@ -1,3 +1,5 @@
+namespace Eigen { 
+
 namespace internal {
 
 template <typename Scalar>
@@ -93,3 +95,5 @@
 }
 
 } // end namespace internal
+
+} // end namespace Eigen
diff --git a/unsupported/Eigen/src/NonLinearOptimization/rwupdt.h b/unsupported/Eigen/src/NonLinearOptimization/rwupdt.h
index ab83f9b..9ce079e 100644
--- a/unsupported/Eigen/src/NonLinearOptimization/rwupdt.h
+++ b/unsupported/Eigen/src/NonLinearOptimization/rwupdt.h
@@ -1,3 +1,5 @@
+namespace Eigen { 
+
 namespace internal {
 
 template <typename Scalar>
@@ -44,3 +46,4 @@
 
 } // end namespace internal
 
+} // end namespace Eigen
diff --git a/unsupported/Eigen/src/NumericalDiff/NumericalDiff.h b/unsupported/Eigen/src/NumericalDiff/NumericalDiff.h
index 52dc0ec..36df9f5 100644
--- a/unsupported/Eigen/src/NumericalDiff/NumericalDiff.h
+++ b/unsupported/Eigen/src/NumericalDiff/NumericalDiff.h
@@ -28,6 +28,8 @@
 #ifndef EIGEN_NUMERICAL_DIFF_H
 #define EIGEN_NUMERICAL_DIFF_H
 
+namespace Eigen { 
+
 enum NumericalDiffMode {
     Forward,
     Central
@@ -134,6 +136,8 @@
     NumericalDiff& operator=(const NumericalDiff&);
 };
 
+} // end namespace Eigen
+
 //vim: ai ts=4 sts=4 et sw=4
 #endif // EIGEN_NUMERICAL_DIFF_H
 
diff --git a/unsupported/Eigen/src/Polynomials/Companion.h b/unsupported/Eigen/src/Polynomials/Companion.h
index 608951d..8936b8f 100644
--- a/unsupported/Eigen/src/Polynomials/Companion.h
+++ b/unsupported/Eigen/src/Polynomials/Companion.h
@@ -29,10 +29,12 @@
 // * Eigen/Core
 // * Eigen/src/PolynomialSolver.h
 
-#ifndef EIGEN_PARSED_BY_DOXYGEN
+namespace Eigen { 
 
 namespace internal {
 
+#ifndef EIGEN_PARSED_BY_DOXYGEN
+
 template <typename T>
 T radix(){ return 2; }
 
@@ -283,4 +285,6 @@
 
 } // end namespace internal
 
+} // end namespace Eigen
+
 #endif // EIGEN_COMPANION_H
diff --git a/unsupported/Eigen/src/Polynomials/PolynomialSolver.h b/unsupported/Eigen/src/Polynomials/PolynomialSolver.h
index 417b93d..71295a1 100644
--- a/unsupported/Eigen/src/Polynomials/PolynomialSolver.h
+++ b/unsupported/Eigen/src/Polynomials/PolynomialSolver.h
@@ -25,6 +25,8 @@
 #ifndef EIGEN_POLYNOMIAL_SOLVER_H
 #define EIGEN_POLYNOMIAL_SOLVER_H
 
+namespace Eigen { 
+
 /** \ingroup Polynomials_Module
  *  \class PolynomialSolverBase.
  *
@@ -394,4 +396,6 @@
     using                   PS_Base::m_roots;
 };
 
+} // end namespace Eigen
+
 #endif // EIGEN_POLYNOMIAL_SOLVER_H
diff --git a/unsupported/Eigen/src/Polynomials/PolynomialUtils.h b/unsupported/Eigen/src/Polynomials/PolynomialUtils.h
index 65942c5..1fb1ed1 100644
--- a/unsupported/Eigen/src/Polynomials/PolynomialUtils.h
+++ b/unsupported/Eigen/src/Polynomials/PolynomialUtils.h
@@ -25,6 +25,8 @@
 #ifndef EIGEN_POLYNOMIAL_UTILS_H
 #define EIGEN_POLYNOMIAL_UTILS_H
 
+namespace Eigen { 
+
 /** \ingroup Polynomials_Module
  * \returns the evaluation of the polynomial at x using Horner algorithm.
  *
@@ -149,5 +151,6 @@
   }
 }
 
+} // end namespace Eigen
 
 #endif // EIGEN_POLYNOMIAL_UTILS_H
diff --git a/unsupported/Eigen/src/Skyline/SkylineInplaceLU.h b/unsupported/Eigen/src/Skyline/SkylineInplaceLU.h
index 5153740..ef36ac9 100644
--- a/unsupported/Eigen/src/Skyline/SkylineInplaceLU.h
+++ b/unsupported/Eigen/src/Skyline/SkylineInplaceLU.h
@@ -25,6 +25,8 @@
 #ifndef EIGEN_SKYLINEINPLACELU_H
 #define EIGEN_SKYLINEINPLACELU_H
 
+namespace Eigen { 
+
 /** \ingroup Skyline_Module
  *
  * \class SkylineInplaceLU
@@ -360,4 +362,6 @@
     return true;
 }
 
+} // end namespace Eigen
+
 #endif // EIGEN_SKYLINELU_H
diff --git a/unsupported/Eigen/src/Skyline/SkylineMatrix.h b/unsupported/Eigen/src/Skyline/SkylineMatrix.h
index 31810df..98a19ce 100644
--- a/unsupported/Eigen/src/Skyline/SkylineMatrix.h
+++ b/unsupported/Eigen/src/Skyline/SkylineMatrix.h
@@ -28,6 +28,8 @@
 #include "SkylineStorage.h"
 #include "SkylineMatrixBase.h"
 
+namespace Eigen { 
+
 /** \ingroup Skyline_Module
  *
  * \class SkylineMatrix
@@ -870,4 +872,6 @@
     const Index m_end;
 };
 
+} // end namespace Eigen
+
 #endif // EIGEN_SkylineMatrix_H
diff --git a/unsupported/Eigen/src/Skyline/SkylineMatrixBase.h b/unsupported/Eigen/src/Skyline/SkylineMatrixBase.h
index 4d0c239..72131eb 100644
--- a/unsupported/Eigen/src/Skyline/SkylineMatrixBase.h
+++ b/unsupported/Eigen/src/Skyline/SkylineMatrixBase.h
@@ -27,6 +27,8 @@
 
 #include "SkylineUtil.h"
 
+namespace Eigen { 
+
 /** \ingroup Skyline_Module
  *
  * \class SkylineMatrixBase
@@ -220,4 +222,6 @@
     bool m_isRValue;
 };
 
+} // end namespace Eigen
+
 #endif // EIGEN_SkylineMatrixBase_H
diff --git a/unsupported/Eigen/src/Skyline/SkylineProduct.h b/unsupported/Eigen/src/Skyline/SkylineProduct.h
index aeedc47..fb653b4 100644
--- a/unsupported/Eigen/src/Skyline/SkylineProduct.h
+++ b/unsupported/Eigen/src/Skyline/SkylineProduct.h
@@ -25,6 +25,8 @@
 #ifndef EIGEN_SKYLINEPRODUCT_H
 #define EIGEN_SKYLINEPRODUCT_H
 
+namespace Eigen { 
+
 template<typename Lhs, typename Rhs, int ProductMode>
 struct SkylineProductReturnType {
     typedef const typename internal::nested<Lhs, Rhs::RowsAtCompileTime>::type LhsNested;
@@ -303,4 +305,6 @@
     return typename SkylineProductReturnType<Derived, OtherDerived>::Type(derived(), other.derived());
 }
 
+} // end namespace Eigen
+
 #endif // EIGEN_SKYLINEPRODUCT_H
diff --git a/unsupported/Eigen/src/Skyline/SkylineStorage.h b/unsupported/Eigen/src/Skyline/SkylineStorage.h
index 62806bf..5721dee 100644
--- a/unsupported/Eigen/src/Skyline/SkylineStorage.h
+++ b/unsupported/Eigen/src/Skyline/SkylineStorage.h
@@ -25,6 +25,8 @@
 #ifndef EIGEN_SKYLINE_STORAGE_H
 #define EIGEN_SKYLINE_STORAGE_H
 
+namespace Eigen { 
+
 /** Stores a skyline set of values in three structures :
  * The diagonal elements
  * The upper elements
@@ -267,4 +269,6 @@
 
 };
 
+} // end namespace Eigen
+
 #endif // EIGEN_COMPRESSED_STORAGE_H
diff --git a/unsupported/Eigen/src/Skyline/SkylineUtil.h b/unsupported/Eigen/src/Skyline/SkylineUtil.h
index e051247..5c5bd8b 100644
--- a/unsupported/Eigen/src/Skyline/SkylineUtil.h
+++ b/unsupported/Eigen/src/Skyline/SkylineUtil.h
@@ -25,6 +25,8 @@
 #ifndef EIGEN_SKYLINEUTIL_H
 #define EIGEN_SKYLINEUTIL_H
 
+namespace Eigen { 
+
 #ifdef NDEBUG
 #define EIGEN_DBG_SKYLINE(X)
 #else
@@ -97,5 +99,6 @@
 
 } // end namespace internal
 
+} // end namespace Eigen
 
 #endif // EIGEN_SKYLINEUTIL_H
diff --git a/unsupported/Eigen/src/SparseExtra/BlockOfDynamicSparseMatrix.h b/unsupported/Eigen/src/SparseExtra/BlockOfDynamicSparseMatrix.h
index 7536437..0cc6e3a 100644
--- a/unsupported/Eigen/src/SparseExtra/BlockOfDynamicSparseMatrix.h
+++ b/unsupported/Eigen/src/SparseExtra/BlockOfDynamicSparseMatrix.h
@@ -25,6 +25,7 @@
 #ifndef EIGEN_SPARSE_BLOCKFORDYNAMICMATRIX_H
 #define EIGEN_SPARSE_BLOCKFORDYNAMICMATRIX_H
 
+namespace Eigen { 
 
 /***************************************************************************
 * specialisation for DynamicSparseMatrix
@@ -123,5 +124,6 @@
 
 };
 
+} // end namespace Eigen
 
 #endif // EIGEN_SPARSE_BLOCKFORDYNAMICMATRIX_H
diff --git a/unsupported/Eigen/src/SparseExtra/DynamicSparseMatrix.h b/unsupported/Eigen/src/SparseExtra/DynamicSparseMatrix.h
index d43149a..151d465 100644
--- a/unsupported/Eigen/src/SparseExtra/DynamicSparseMatrix.h
+++ b/unsupported/Eigen/src/SparseExtra/DynamicSparseMatrix.h
@@ -25,6 +25,8 @@
 #ifndef EIGEN_DYNAMIC_SPARSEMATRIX_H
 #define EIGEN_DYNAMIC_SPARSEMATRIX_H
 
+namespace Eigen { 
+
 /** \deprecated use a SparseMatrix in an uncompressed mode
   *
   * \class DynamicSparseMatrix
@@ -365,4 +367,6 @@
     const Index m_outer;
 };
 
+} // end namespace Eigen
+
 #endif // EIGEN_DYNAMIC_SPARSEMATRIX_H
diff --git a/unsupported/Eigen/src/SparseExtra/MarketIO.h b/unsupported/Eigen/src/SparseExtra/MarketIO.h
index 3b10391..d034d8e 100644
--- a/unsupported/Eigen/src/SparseExtra/MarketIO.h
+++ b/unsupported/Eigen/src/SparseExtra/MarketIO.h
@@ -25,6 +25,9 @@
 
 #ifndef EIGEN_SPARSE_MARKET_IO_H
 #define EIGEN_SPARSE_MARKET_IO_H
+
+namespace Eigen { 
+
 namespace internal 
 {
   template <typename Scalar>
@@ -274,4 +277,7 @@
   out.close();
   return true; 
 }
+
+} // end namespace Eigen
+
 #endif // EIGEN_SPARSE_MARKET_IO_H
diff --git a/unsupported/Eigen/src/SparseExtra/RandomSetter.h b/unsupported/Eigen/src/SparseExtra/RandomSetter.h
index b4e6afb..9328c60 100644
--- a/unsupported/Eigen/src/SparseExtra/RandomSetter.h
+++ b/unsupported/Eigen/src/SparseExtra/RandomSetter.h
@@ -25,6 +25,8 @@
 #ifndef EIGEN_RANDOMSETTER_H
 #define EIGEN_RANDOMSETTER_H
 
+namespace Eigen { 
+
 /** Represents a std::map
   *
   * \see RandomSetter
@@ -335,4 +337,6 @@
     unsigned char m_keyBitsOffset;
 };
 
+} // end namespace Eigen
+
 #endif // EIGEN_RANDOMSETTER_H